Jump to content

form help $PHP_SELF


MDanz

Recommended Posts

i have a form on submit.php, with method post to the same page($PHP_SELF).  If i made a mistake i want to be able to go back to the previous page(same page) and have the values in their textfields.

if(isset($_POST['new'])) {
<a href='#' onClick='history.go(-1)'>Go Back</a>
}
else {
// code

}

 

The problem is.. it goes back to the page as planned and then it changes page to submit.php#.  the previous page was submit.php?search=test. 

 

Link to comment
https://forums.phpfreaks.com/topic/229724-form-help-php_self/
Share on other sites

the form is made up of text fields, with a button to add more textfields done with javascript.  So i need the onclick='history.go(-1)', to have the newly added textfields displayed when the user goes back.

 

the onclick='history.go(-1)' is needed so if the user has went above the word count they can go back and change the values and re-submit, then the values are inserted into a database.

 

 

Link to comment
https://forums.phpfreaks.com/topic/229724-form-help-php_self/#findComment-1183403
Share on other sites

So this is really more of a javascript question then, since you'd have to submit the form to have php do anything with it. I'm afraid that when you go much further than alert() in javascript, I'm pretty much useless. I'll move the thread to the javascript forum though, since that seems to be the right place for it.

Link to comment
https://forums.phpfreaks.com/topic/229724-form-help-php_self/#findComment-1183405
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.