Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hi all,
i am submitting a registration form's data to another php file using post method,
Now if some error occurs, i want to redirect user back to the page from where he
came, with an error reporting.
How can i refill the data in that form fields ?
On second page i 've used following code :Code: Select all
//if error then do following
send_back('Create_New_Account.php');
function send_back($action)
{
print("<form name='frmBack' id='frmBack' action='".$action."' method='post'>");
foreach($_POST as $key => $value)
{
print " <input id='".$key."' name='".$key."' type='hidden' value='".$value."'>";
}
print("</form>
<script>
document.frmBack.submit();
</script>");
}Code: Select all
document.frmBack has no propertiesPlease tell me how can i submit all the fields of this form to the previous page?
Note: on previous page i 'll use $_POST['var_name'] for data check.
regards
WAQAS
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]