jpopuk Posted October 27, 2010 Share Posted October 27, 2010 Hi, I have setup a basic enquiry form with a Captcha - once the code has been inserted and is correct I want to action the form (submit) in PHP. <?php session_start(); if($_SERVER['REQUEST_METHOD'] == 'POST'){ $vResult = ''; if(strtolower($_SESSION['security_code']) != strtolower($_POST['security_code'])){ $vResult = 'Invalid code!'; } else{ "/enquiry.php" } } ?> I want to submit the form to /enquiry.php - I tried header(Location.. and realised that just redirects, and doesn't submit the form. Any suggestions or tips would be great. Cheers, Paul Link to comment https://forums.phpfreaks.com/topic/216975-submit-form-in-php/ Share on other sites More sharing options...
abdfahim Posted October 27, 2010 Share Posted October 27, 2010 I think you should use Javascript rather, to serve your purpose ... Link to comment https://forums.phpfreaks.com/topic/216975-submit-form-in-php/#findComment-1127012 Share on other sites More sharing options...
jpopuk Posted October 27, 2010 Author Share Posted October 27, 2010 Yeah, I did have a little read up on this as most places did mention javascript is better to action a form. Will post in a javascript forum. Cheers. Link to comment https://forums.phpfreaks.com/topic/216975-submit-form-in-php/#findComment-1127015 Share on other sites More sharing options...
trq Posted October 27, 2010 Share Posted October 27, 2010 In your code, where you have "/enquiry.php", you need to put the code contained within enquiry.php there. Making another request is a waste of resources. Link to comment https://forums.phpfreaks.com/topic/216975-submit-form-in-php/#findComment-1127045 Share on other sites More sharing options...
jpopuk Posted October 27, 2010 Author Share Posted October 27, 2010 Yeah, that is what I am going to resort to - cheers ! Link to comment https://forums.phpfreaks.com/topic/216975-submit-form-in-php/#findComment-1127053 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.