Jump to content

redirect from one page to other directory php page.


chennaibala

Recommended Posts

hi frds,

    i want to redirect from one page to other directory php page.it poosible?

assume

rite now we are in login page.after submit i should redirect my  page called gift.php which in other sub directory(newyear)

from /login.php to /newyear/gift.php.

 

header('Location: /newyear/gift.php); it not works..any other way?

 

thanks in advance

 

 

if you wrote the code as you did in your post, then your missing the second apostrophe:

header('Location: ./newyear/gift.php');

 

if you did type it correctly within your code, then what errors do you recieve (if any)

 

and what is your entire code for the login submit page?

how are your directory paths structured?, am i correct in thinking the two file paths go as follows...

RootDir/login.php

RootDir/newyear/gift.php

if they do go like this then i am not sure why your recieving a 404 error

 

 

 

BUT, if your directories go somthing like this...

RootDir/someDir/login.php

RootDir/someDir/newyear/gift.php

 

then you need to remember to add a dot before the forward slash within the header code to make sure its looking for the redirect page from the current directory and not the root directory:

header('Location: ./newyear/gift.php');

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.