PDA

View Full Version : executing php on same page on form submit



bberry91
12 Nov 2010, 04:22 PM
i want to combine the submit page with the form page, but it gives an error, which i don't want the script to run until it is called upon... how would i do this?

thanks!

589

pricey_uk
15 Nov 2010, 04:31 AM
If I understand you correctly then you should be able to put something like this at the top of the PHP script:

if (isset($_POST['doLogin'])){
}

include all the code you only want run after form submission within the if clause. This should check whether the login button has been pressed