Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2011
    Posts
    20
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Redirect to "header 'Location: URL' ...but include in the code this: rel="lightbox"

    Hi

    I am designing a php code to open a Light Box if the statement calls true.

    The else is here:

    Code:
    	else {
    	header('Location: http://www.this_domain.co/light_box/image-1.jpg');
    But i want to have this attribute included: rel="lightbox" or it won't open the iframe that the Light Box is meant to be in.

    With out that bit of code the image just opens in a browser window, and without the iframe.

    Does anyone know how to fix this?

    thanks
    steve

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    By not redirecting to an image.
    Header Location is used to change to an alternate location. If you provide it an image, it will go to an image, not an html page. The only way to target using an iframe using a header is to make sure that the location is being triggered by the script within the frame, and not from within the window.
    PHP is server side, it doesn't know anything about a frame, nor does it care. The extent of what PHP will care about is creating an iframe tag and giving it a target. It will serve this to the browser that decides what to do with it.

  • Users who have thanked Fou-Lu for this post:

    new_to_this (05-29-2011)

  • #3
    New Coder
    Join Date
    May 2011
    Posts
    20
    Thanks
    5
    Thanked 0 Times in 0 Posts
    ok, thanks very much for that,
    sc


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •