[PHP] Redirect after submit
Hi, I have a page that contains multi If ElseIf statements. I want to redirect right after a user submits gets a message (echo Entry Added to Database. \n; ) would you like to add another. then prompts for an alert. Would you like another ??? and redirects to a page based on selection. SCRIPT language=JavaScript !-- function go_there() { var where_to= confirm(Would you like to create another ??); if (where_to== true) { window.location=body.htm; } else { window.location=update.php; } } //-- /SCRIPT I have this jscript but not sure how to implement after the (echo entry added to database) line ? any suggestions. would be greately appreciated. Thank You Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect after submit
Where exactly do you see PHP fitting into this. It looks like it's all Javascript, and that's client-side nonsense... ---John Holmes... - Original Message - From: Daniel Negron/KBE [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 9:27 AM Subject: [PHP] Redirect after submit Hi, I have a page that contains multi If ElseIf statements. I want to redirect right after a user submits gets a message (echo Entry Added to Database. \n; ) would you like to add another. then prompts for an alert. Would you like another ??? and redirects to a page based on selection. SCRIPT language=JavaScript !-- function go_there() { var where_to= confirm(Would you like to create another ??); if (where_to== true) { window.location=body.htm; } else { window.location=update.php; } } //-- /SCRIPT I have this jscript but not sure how to implement after the (echo entry added to database) line ? any suggestions. would be greately appreciated. Thank You Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect after submit (solved)
I see a PHP page that adds an entry to the database then goes to a page that says Your entry has been entered from the PHP page. what I am looking for is how to redirect after that page has been submitted and the entry is added to the database and the page tells me that I have entered the information into the database IF I would like to add another entry in to the database, again using php. I dont think I submitted this to the wrong group. I thought for a moment that I might get hammered for asking a mixed javascript, php, mysql question, but I thought that someone would actually see what I was trying to do. But just to let you know I just worked around the problem by closing out that php tags entering some jscript and and html and then re-opening the php tags. So thank you any hoo. Thank You Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com |+-- || 1LT John W.| || Holmes | || holmes072000@ch| || arter.net | || | || 05/06/02 10:08 | || AM | || Please respond | || to 1LT John W. | || Holmes | || | |+-- -| | | | To: [EMAIL PROTECTED], Daniel Negron/KBE [EMAIL PROTECTED] | | cc: | | Subject: Re: [PHP] Redirect after submit | -| Where exactly do you see PHP fitting into this. It looks like it's all Javascript, and that's client-side nonsense... ---John Holmes... - Original Message - From: Daniel Negron/KBE [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 06, 2002 9:27 AM Subject: [PHP] Redirect after submit Hi, I have a page that contains multi If ElseIf statements. I want to redirect right after a user submits gets a message (echo Entry Added to Database. \n; ) would you like to add another. then prompts for an alert. Would you like another ??? and redirects to a page based on selection. SCRIPT language=JavaScript !-- function go_there() { var where_to= confirm(Would you like to create another ??); if (where_to== true) { window.location=body.htm; } else { window.location=update.php; } } //-- /SCRIPT I have this jscript but not sure how to implement after the (echo entry added to database) line ? any suggestions. would be greately appreciated. Thank You Daniel Negrón Lotus Notes Administrator / Developer KB Electronics, Inc. 954.346.4900x122 http://www.kbelectronics.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Redirect after submit
-Original Message- I have a page that contains multi If ElseIf statements. I want to redirect right after a user submits gets a message (echo Entry Added to Database. \n; ) would you like to add another. then prompts for an alert. Would you like another ??? and redirects to a page based on selection. -Original Message- The moment you output anything to your page you can't do an automated redirect using the header() function. If you need to output something and then do a redirect automatically then you're going to have to start fiddling quite a bit. The first thing that springs to mind would be inserting a meta refresh in your head but this won't help if you have a conditional redirect. The second would be to do it in javascript where your alert box determines what url to go to and you use that javascript to do the navigation (perhaps by simulating a form submission). CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php