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 press '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 {
// form in here
}
The problem is.. it goes back to the page as planned(submit.php?search=test) and then it changes page to submit.php#.
I need to use onclick='history.go(-1)' because the form is made up of text fields, with a button to add more textfields done with javascript.
So if i added 3 textfields and used onclick='history.go(-1)' the 3 textfields will still be there.