So I have an lc script that a user goes to that presents them with a list of editable fields showing data pulled from a database. The user can edit the info in the fields and press a button, which submits the data to another script via POST. That script then adds/deletes/updates the database (depending on the button clicked on the previous page - doesn't really matter for this). At the end of this processing, I would like to have the script send the user back to the previous scipt, which would now display the updated information,a nd allow them to make more changes if they want. So, basically the second script is "invisible - all the user ever sees is the main page (unless there is an error or something - in that case I want the second script to display an error message for a bit, then redirect back to the orignal page.
Here is what I have been trying:
this is the content of redirect.txt referenced below:
<meta HTTP-EQUIV="REFRESH" content="[[rTimer]]; url=http://localhost/idmgmt/">
Code: Select all
--this is the code I have to display an error page for 10 seconds before redirecting if the result is not a number then -- check the result and display the error message, if there is one revCloseDatabase theDBID put "10" into rTimer put url("file:redirect.txt") into theHTTPHeader put merge(theHTTPHeader) into theHTTPHeader put header theHTTPHeader put"<html>MYSQL ERROR</html>" exit to top end if --this is the code to go back to the original page if everything works fine put "0" into rTimer put url("file:redirect.txt") into theHTTPHeader put merge(theHTTPHeader) into theHTTPHeader put header theHTTPHeader put "<html></html>"
Now that I have written all this out, it occurs to me that the best solution is probably to not have two scripts - instead have one script that checks to see if $_post has anything in it, process that if it does, then display the edit page from the same script, and have the submit go right back to this same script. It seems like it would work...
Still, it would be nice to know how to send a user to web page other than the one that was posted to.