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 Quote 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 ... Quote 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. Quote 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. Quote 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 ! Quote Link to comment https://forums.phpfreaks.com/topic/216975-submit-form-in-php/#findComment-1127053 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.