How To Redirect A User BACK To The Page
how to redirect a user BACK to the page they were trying to access while not being logged in, AFTER they log in.
for example, i try to access page1.php, but i am not logged in so a header("Location: login.php"); directs me to the login page. then i login, and the script redirects me back to page1.php...
i tried this using the $SERVER['HTTP_REFERER'] variable but it doesnt give a value unless the user CLICKS on a link to the next page (redirecting using headers doesnt work)
View Complete Forum Thread with Replies
Related Forum Messages:
Redirect The User Back To The Page The Submited The Form From.
I have an email form on a site that I am working on. It sends from a small JS popup that is activated by clicking on a link. that form sends to a php page which sends the user entered variables to an email address. what I am looking to do is instead of going to a new page when the form is sent I want to redirect the user back to the page the submited the form from. I have it set up to send a hidden var to the php page with the full url of the origional form. here is the functional code I have on the php page. what is hapening is the email is being sent but the php page is being displayed instead of redirecting. Code:
View Replies !
Want My User To Have To Go Back To The Index Page As Soon As They Login.
I am having a little trouble intergrating a login/user management script with my html pages. I have used the div tag put in my php in there and put the rest of the php where it is originally placed in the script. Here is my problem. I would like my user to stay on the same main page while the login part changes(goes to the members area). I have tried using i-frames but if there is a link in one, the main page does not change the i-frame does. Can this be solved with more php. I do not want my user to have to go back to the index page as soon as they login.
View Replies !
Redirects The User Back To The View Page
i am facing a strange problem of redirection. After the user fills up the form, i submit the data to save.php file and at the end i have a header which redirects the user back to the view page.Below is the code of save.php: Code:
View Replies !
Redirect A User To The Related Page
I have made a script that redirect a user to the page related to the month. I bind the month numbers to the url as uitrukken.php?md=05 Now....i would print the month name on my page. I have made the following array. <?PHP $maanden = array( 01 => "Januari", 02 => "Februari", 03 => "Maart", 04 => "April", 05 => "Mei", 06 => "Juni", 07 => "Juli", 08 => "Augustus", 09 => "September", 10 => "Oktober", 11 => "November", 12 => "December" ); echo $maanden['$md']; ?>
View Replies !
Redirect The User To His Own Page Once It Login
i have created a login page .. and i need to redirect the user to his own page once it login.. in the other words.. i need to redirect the user to his own database.. but the login details is stored in another database... just like once you login into your own account and it is displaying only your details.. hmmm how can i do that with php ... what method is easier and suitable ?? if can juz kindly show me how the code look like too..
View Replies !
How To Automatically Redirect The User To Another Page
i have figured out how to automatically redirect the user to another page, but now i'm stuck again. i want to be able to maintain user information and variables for the duration of the user's "stay" at my site. obviously i have to use sessions and cookies but i have tried everything to it get to work .
View Replies !
How To Redirect User To A Page When Error Occurs ?
I tried to play around with "error_reporting(0);" and "set_error_handler("showError");" but failed. How can I redirect a user to a page, like saying "sorry ...etc" whenever there's error occur, rather than showing the error message for every single error ?
View Replies !
Session Expired -> Redirect User To Another Page.
I am using the new session management function from PHP4. session_start() how do u redirect a user to another page if his session is expired? here is what i want to do: 1. user Tom enter his correct username and password. 2. my system use session_register() function register a variable in his cookie. 3. user Tom clicked Logout 4. my system use session_destory() function and redirect Tom to the login page. 5. Now, Tom click the 'BACK' button of his browser, a page showed 'page expired, hit reload button ... ...'. here is my question, how do I redirect Tom to the login page if he clicked the BACK button?
View Replies !
How Redirect A User To Another Page And Send Some Variable With The Post Method?
I make a user registration. It contains two/more page. First page is for official purpose. User ID, password and some other official information is in first page and user basic information is in second page. If user enter an user id that already exist in database then a message show the same page to change his user id otherwise page is redirect to second page and send user id, and other variable that was in first page. My Code:
View Replies !
Multi User/ Multi Page Redirect To Particular Clients Page
I need all of my clients to be able to go to ONE login page. based on their user ID number and password be able to login to their particular page, I do not want them seeing any of my other clients information. seems easy... now why cant i figure it out. I want the back end of it in mySQL, with a way for: admin to easily update the information located in there...ie: go to client 1 add new invoice information, new expiration date, etc. clients to easily update their billing information, etc from their personal page, is a must also. I just want to know if going with PHP is the best bet, or if there is another way..
View Replies !
Automatically Redirect Back To Somewhere Else I Specify
Im building a site using php includes, and I want to log out, but my log out page is a include, and the includes take place halfway down the page, so it throws the error cannot modify headers, headers already sent by the template page so I figure the logout script has to be the first thing on the page, right? but since it doesnt need any input anyway, I figured how about setting that link to go to a whole new invisible page called logout.php, instead of another include. Ok so that would work, the question is, how do I get that page to then automatically redirect back to somewhere else I specify, after its executed that code? Also ideally Id like to send some vars back with it- like err.. to say whether logout was sucessful or not.
View Replies !
Redirect The Logged In User To Home.php Without Any Clicking From The User
I have this login script that calls on itself to authenticate the username and the password. It redisplays the login page if there is an error. My question is how do I redirect it to a different page, when the user is authenticated (i.e. the address in the address box changes to a new name, for example, if the login page is called login.php,. then I want to redirect the logged in user to home.php without any clicking from the user). I realize that there is a header function available, but I've heard that any information related to the current session is lost upon using this function. Is there any better way?
View Replies !
Page Expired After Going Back From Del. Pageto Form Page Where Comment Is Submitted..
i've made a submit comment form with php and mysql, the form has an action to itself with a hidden var like this: input type=hidden action=add When i delete a comment on the page i go to a page called delete.php3 and there is a link with a javaline which goes -1 back in my history.. When ive added a comment, the comments page contains action=add and when i delete a comment, i want to click on the link to go back to the comment page, but then, it doesnt work and it says: Page has expired. I wondered how to deal with this kind of problems........
View Replies !
Page Has Expired Message In Between The Php Page When I Click Back In Explorer Menu
I have a php script page, which is basically quiz. Visitors (after login in with their email address) are supposed to answer each question, and when they click the button at the bottom, the next page will show which problems they got right or wrong. Now my visitors, after seeing some problems they got wrong, click Back button at the Explorer menu, and if they do, they get the below message: ========================= Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. ======================== Below are the script that I am using. This scripts are after initial login page, which asks for visitor's email address. I have authorized visitors already in my MySQL table, and only the visitors whose email address is in my MySQL table are allowed to login......
View Replies !
Getting Back User Password From Htaccess
I am performing authentication by using .htaccess and .htpasswd file in appropriate directory. Once the user has successfully sign on, is there any PHP variable set with the user and the password which have been entered on the Realm panel ?.
View Replies !
User Selects Browser Back Button
I using a alert JavaScript message to display once an user submits a form, the message displays fine, but say the user goes to another screen and hits the browser back button, the same message displays again, is there a way to clear the message once displayed the first time.
View Replies !
Preventing POST Again When User Clicks Back Button
I have a number of forms that do significant work based on variables POSTed from the form. What is the common method of detecting and preventing this work from being done when the form is POSTed as the result of the user clicking the Back or Reload buttons in the browser?
View Replies !
Redirect A User
I am looking to create a directory when a user logs in, and have that user redirected to their page logon. I have this script, which I haven;t implemented, but I would like your opinion....
View Replies !
Redirect The User To Maybe 00.000.000.00:81
I have live.church.com to a local sever IP address. Lets say 00.000.000.00. So church.com is being hosted by some company and they have it so that live.church.com is being redirect to a local server like I said. So I am wanting this local to see where the user is coming from and redirect them from there. Like I am wanting it to detect if the user came from live.church.com and then redirect the user to maybe 00.000.000.00:81 or maybe even a different IP or 00.000.000.00/live/ Is that possible in any way? I mean I really need this for my church and streaming live audio.
View Replies !
Log In Page That Goes Back To REFERRING Page
I am using the following code to initialise a session, depending on whether-or-not the users' log in attempt has been successful. if ($session_ok == "TRUE") { //open the session session_start(); //assign user details to session $_SESSION[txt_user] = $user_id; $_SESSION[user_pass] = $user_pass; $_SESSION[ses_state] = "TRUE"; header("Location: ../index.php"); } as you can see the script then refers back to my index.php page, after the session is ok'd. What I would like to do is change this so that is goes back to the referring page, instead of the index.php page, which requires the user to then navigate to their previous page again. I have attempted to use $HTTP_REFERER, although for me (on IE6) for some reason their is no value in the variable!
View Replies !
I Want The Page To Go Back To My Login Page.
I want to logoff my application and I have set up a link to do this. I got it to destroy my session, but I can't get the page to go to the top of the browser and do a page refresh. Here is the code I am using. First there is the link I am using. printf("<a href="%s?logoff=%s">%s</a><br>", $_SERVER['PHP_SELF'],"logoff", "LOGOFF"); Here is piece I use right at the top of the script to destroy the session and try to refresh the page. if (isset($_REQUEST['logoff'])){ session_destroy(); $_SERVER['PHP_SELF']; } What do I have to do to get the refresh to work?
View Replies !
Redirect User To Another Webpage
When a user inputs a "topic" into our form I want to redirect them to another webpage. Everytime a user inputs something into our form, the browser tries to download the script instead of execute it. I am not sure what is going on. Here is the form: <form action="/cgi-bin/search.php" method="GET" > <input type="text" name="keyword" size="15" /> </form> Here is search.php: #!/usr/local/php/bin/php header('Location: http://www.somewhereelse.org'); **misc info the script perms are 755 AddHandler cgi-script .cgi .php AddType application/x-httpd-php .php .html .cgi I maybe using the wrong approach.
View Replies !
User Login Redirect
Here what i got so far: if (!isset($_SESSION['logged_in'])){ Â Â // not logged in, show form echo "<form action="{$_SERVER['PHP_SELF']}" method="post"> user id <input type="text" id="username" name="username" size="30" value="" /><BR /> password <input type="password" id="password" name="password" size="30" value="" /><br /> <input type="submit" name="Login" value="Login" /></form>"; } else { header("Location: members.php"); }
View Replies !
Email Form - I Want To Redirect The User Once
I am creating an email form, which works properly thus far. I have used "echo" to display a thank you message to the user after he/she clicks submit, but this is not going to work for us as we specifically need an HTML thank you page for the sake of Google and Yahoo tracking (I will be inserting code from both Yahoo and Google shortly). Basically, I just want to redirect the user after submitting the form. Code:
View Replies !
'Back' Page After Logout
I'm using HTTP authentication as my login mechanism, and I'm having problems with the logout. It appears to work (as in I get the right message when I've logged out) but pressing the 'Back' button gives me the information on the previous page as though I hadn't logged out at all. 1) Does $PHP_AUTH_USER not get cleared when a "401 Unauthorized" is encountered? 2) Is there any way to force the logout to apply to previous pages (I'm thinking using sessions or cookies perhaps), or do I have to get the user to close the browser window?
View Replies !
Back To Previous Page?
is it a way that we can have "go back" to our previous page? cos normally when we use back command in our IE or NS. we should have this error message appeared Warning: Page has Expired blah blah blah.. so how should I program so that i can "go back" e.g: i got two php, fromhere.php and cominghere.php is there anyway that i can do in order to reach the page "fromhere.php"?
View Replies !
Going Back To A POSTED Page
how can i stop the browser from warning the user that "Post Data" will be resubmitted... For example, on goolge you do a search, then click on a link, then clikc the BACK button in your browser, it dosn't give you the warning that you are going back to a page with posted variables?
View Replies !
Posting Back To The Same Page
I have a website that uses user authentication. The login does a post back to itself to check set usernames and passwords. <?php echo $_SERVER['PHP_SELF']?> sample url: .../admin/login/index.php This is working on a linux box where the end of the php code sends the page off to a ccc.php page for access checking. So after logging in on the index.php page, you eventually get returned to admin/ccc.php. I reused the same code on a windows box and the .../admin/login/index.php takes me to .../admin/login/index.php/admin/login/index.php does anyone have a clue as to what might cause this?
View Replies !
Does 'Back' Reload The Page?
I notice that when I click the 'Back' button my previous script runs, i.e, all the php code runs (I previously thought that maybe the previous form displays without the code re-running). However, I do not get the expected value displayed on my form. After populating one element in formA with ཌྷ' (just any number) and submitting to formB (using POST ---> Redirect --> GET to avoid the 'expired from cache' message) I then click the 'Back' button and the 17 does not appear. In the code below, after clickng 'Back', I see as output from the echo statement that rb_value[0] is, infact, ཌྷ' but within the form, the text element named rb_value[0] displays as empty. Does anyone have suggestions why this might be? It might have to do with that I do not understand what the 'back' button does. Or maybe with my PRG (post - redirect - get) model. Here is part of the code: echo "rb_value[0]=".$rb_value[0]; //After clicking 'Back' I see that rb_value[0] is 17 if (isset($rb_value[0])) { $rb_val = $rb_value[0]; } else { $rb_val = 1; } $line.= "<td width="20%" valign="center" align="left"> "; // This element displays as empty instead of the expected 17 $line.= "<input type=text name="rb_value[0]" value="$rb_val" size="25" maxlength=25 </center> " $line.= "</td> ";
View Replies !
Go Back To The Previous Page
is there any simple way of knowing which page within the site the user came from? Since after the user do something such as logging in and i want to be able to redirect the user back to the page from which he/she came from.
View Replies !
Back To Last Page Viewed
i was wondering if php is capable of doing the following and if so was hoping i could get some help doing it. i have a wordpress blog and change the content of the sidebar depending if the page being viewed is part of the blog (home, archive, search, or single post) or an actual seperate page (like the about, disclaimer etc). what i'd like is to have a link on the sidebar when viewing a page that says "back to blog" thats acts as a back button like in a browser, going back to the last page viewed. except what i want is for it to go back to any page that isnt a page, so basically the last blog page. um, does that make sense?
View Replies !
Page If Back Button
I have a php page which is a sign up page, once signup is finished the user is redirected to a new page. Sometimes (and it's rare) the user hit's the back button and then re-submits the form etc. I mean like I said it's rare but still bothers me, so on the last page I kill all the sessions. Which only works if the user hits the back button but the page is refreshed. So basically I want to know if it's possible that when the back button is hit to refresh a php page?
View Replies !
Ob_start() And Going Back To The Previous Page
1. How do I go back to the previous page using PHP? For example, I have a log-in process which validates username and password of members, and also retricts access to certain pages. So if a member goes into a page without logging in, the member will be presented with a form to log in. How can I make my script go back to the previous page they were trying to access prior to logging in? 2. What would happen if I use ob_start and ob_end_flush() on every page that I have? Would it affect loading time? Or would loading time be the same except that it would cache everything first? Isn't that suppose to make it appear that the page loads fast?
View Replies !
|