PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, April 15, 2022

[FIXED] How would set a response header X-Frame-Options?

 April 15, 2022     html, httpresponse, iframe, response     No comments   

Issue

I need help with setting a response header for my site, hosted on Github pages. How would I set the X-Frame-Options option to DENY? I could use HTML, CSS, JS, or PHP.

I have tried using <meta http-equiv="X-Frame-Options" content="deny"> but I got this message in console:

X-Frame-Options may only be set via an HTTP header sent along with a document. It may not be set inside <meta>.

UPDATE

Since I can not edit the headers because my site is hosted on GitHub, is there a way to check if the page is in an iframe and display an image instead of the content?

Any ideas are appreciated!


Solution

You can't.

Github pages does not provide any mechanism for customising HTTP response headers (including running server-side code in any programming language).



Answered By - Quentin
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing