hello..
i am clicking url which redirects to my webpage. for example user is not login to that site then it redirects to login page. up to there its fine. after user login how can i redirect to requested page?
muralibobby2015 17 Posting Pro
Recommended Answers
Jump to PostWhen redirecting them in the first place add into the redirect url
"login.php?url=".urlencode(/path/to/page/from.php);
Then on the form you place in the action= parameter the above path which is now in the $_GET tag.
Jump to PostIt is simple really. When you link you include the url of that page in that link. So for example:
<?php echo '<a href="anotherpage.php?previouspage='.urlencode($_SERVER['REQUEST_URI']).'">Test link</a>'; ?>
Then anotherpage.php
$login_status=true; if ($login_status==true) { header('Location: http://yoursite.com'.$_GET['previouspage']); //no ending …
Jump to Postdo i have to pass all that through GET method ?
is it possible to get that variables through another method ?Well other options include sessions and cookies. If you don't want that in the url then I would suggest using cookies. To use cookies place the following at …
All 10 Replies
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
pbcomput 9 Junior Poster in Training
logonchristy 0 Light Poster
muralibobby2015 17 Posting Pro
logonchristy 0 Light Poster
almostbob 866 Retired: passive income ROCKS
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
pbcomput 9 Junior Poster in Training
cwarn23 387 Occupation: Genius Team Colleague Featured Poster
Girish24041984 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.