ultrasound0000 Posted April 29, 2009 Share Posted April 29, 2009 I'm submitting a form to an external site. The page where I post on the external site processes the form values. I don't have access to the external site, so I have no control of it. I need to validate the form data using PHP before I post to this external site. I have figured out how to validate the form in PHP, so that's not a problem. My problem is: how do I then post the form to the external site once the validation is all clear? If I put the external site in the action="externalsite.com" then my PHP server-script validation is skipped. I don't have a DB back-end or cUrl installed, so for now can't use either and I'm looking for another solution. I am stuck so any help would be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/156058-need-help-with-form/ Share on other sites More sharing options...
mikesta707 Posted April 29, 2009 Share Posted April 29, 2009 yes you can. have that submit page submit to a different page (maybbe sanitize.php) have that page take the variables, and populate a form with however many hidden fields that you need, and then submit the form with javascript IE $var = $_POST['my+var']; //sanitize here ?> <form action="what_ever.ext" method="post" name="MyForm"> <input type="hidden" name="hiddenfield1" value="<? echo $var; ?>"> </form> <script language="javascript" type="text/javascript"> document.MyForm.submit(); </script> <noscript><input type="submit" value="verify submit"></noscript> Hope that helps! Link to comment https://forums.phpfreaks.com/topic/156058-need-help-with-form/#findComment-821579 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.