[SOLVED] go where you come from.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ozkandokuz
Forum Newbie
Posts: 4
Joined: Tue Sep 14, 2004 2:51 am

go where you come from.

Post by ozkandokuz »

I have a site which provides login section on every page of it.(with include function) The problem is that when the user login the site with his username he is redirected to the index.php. However I want him to go to the page that he login to the site.
For example the user is on the products page. He will enter from this page. After login I want him to come again to the products page.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

When you submit the login form send the details of the page with the form and then use that info in the redirect.
ozkandokuz
Forum Newbie
Posts: 4
Joined: Tue Sep 14, 2004 2:51 am

Post by ozkandokuz »

how can I send the details with the form.
Which php funciton holds the page name that the form submitted?
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Code: Select all

<input type="hidden" name="location" value="<?php echo $_SERVER&#1111;'PHP_SELF']; ?>">
Or do a print_r($_SERVER); to see what other values you could use.
ozkandokuz
Forum Newbie
Posts: 4
Joined: Tue Sep 14, 2004 2:51 am

Post by ozkandokuz »

Thanks a lot.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Post Reply