2

I'm working with a client who's forced to use a widget based web builder to manage their web content.

They're trying to include product images for consumers. Basically, they send an email with a product overview that comes with pictures. Seeing how we can't place a working image gallery in the email we decided to use php to build a gallery hosted on another site that swaps the images out via ?cat.

The site itself works fine. iFrameing it isn't working though. Is there a way to target the iframe on the page to adjust the content accordingly?

Just to sum it up:

Email contains a url that takes the user to a web page with an iframe-d in image gallery that changes what images are displayed depending on the cat written in the emailed url.

note: User doesn't see gallery in the email but on a web page they are directed to from a link in the email.

  • you're trying to embed the remote site in the email? unless the user allows their mail client to fetch external resources, that won't work at all. – Marc B May 26 '16 at 14:57
  • Gallery is not in email, but its on a external url that is included in email? – Faraz May 26 '16 at 15:01
  • Yes, the url in the email takes the user to the business' website. Since I can't bulild the gallery using their web builder platform the gallery is hosted on another site and is displayed on the businesses page via iframe. – joethemovie May 26 '16 at 15:10

1 Answers1

0

It because of X-Frame-Options, you Gallery site need to tell browser that its allowed to add contents. In php you can it to header using

The page cannot be displayed in a frame, regardless of the site attempting to do so.

<?php header('X-Frame-Options: DENY'); ?>

The page can only be displayed in a frame on the same origin as the page itself.

<?php header('X-Frame-Options: SAMEORIGIN'); ?>

The page can only be displayed in a frame on the specified origin.

<?php header('X-Frame-Options: ALLOW-FROM https://www.iframe_webite'); ?>

According to firefox website

Some more help on this answer

The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a , or . Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.

Community
  • 1
  • 1
Faraz
  • 751
  • 7
  • 23