Forum Moderators: coopster
What I am having trouble with is if the validation comes back fine how can I make the form submit to process.php. I have tried using <form action=$someVariable and on my final function for validation if it returns with no problems changing that variable to process.php but because I have multiple php breaks throughout the page because it is an html page it doesn't seem to pass the variable up.
As a test I put the variable in the form action and in the same php area as that I set the variable to process.php and it went to that page fine, my problem is that I want to set the variable at my last function and have it send it up.
Hope I didn't confuse anyone.
Thanks for the help
What I suggest you do is have a think about how you can include it all in one page. Here's a bit of a pseudo layout to do that.
if(form is posted)
{
validate data
}
if(form is not posted or data is not valid)
{
display form
}
else
{
process data
redirect to or display the success page
}
<?php
..validate input
//use curl_lib:$url = "http://localhost/process.php";
$params = "param1=".$_POST['input1']."¶m2=".$_POST['input2'];$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url); //append URL
curl_setopt($ch, CURLOPT_POST,TRUE);//We are using method POST
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);//append parameters// results will be outputted to the browser directly
curl_exec($ch);
curl_close ($ch);
...
?>
This will replace you page with whatever process.php does..