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

 

 

Link to comment
Share on other sites

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');

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.