cactuscake Posted October 17, 2009 Share Posted October 17, 2009 Got a problem with a php website I'm creating. In a nutshell, the first page is entirely html and calls a php script to process an uploaded file and some form fields using POST. After validating the uploaded file the script echos a new page with a new form containing hidden inputs to carry forward the extra information provided in the original form (this was easier than getting my head around cookies). It works, because when I view the generated source all of the hidden input values have been populated with the correct information. The problem I am having is with the next part of the process - the echoed page includes a new button that is supposed to call a separate php script, using the new form values. But when the button is clicked, it executes the existing php script again (and fails on the validation) instead of running the correct script as referenced in the onClick attribute of the button. Any idea what I'm doing wrong? or why it is behaving like this? Quote Link to comment Share on other sites More sharing options...
cags Posted October 17, 2009 Share Posted October 17, 2009 Why are you using the onClick attribute. Providing you have something like... <form action="script_to_post_to.php" method="post"> <!-- your fields here --> <input type="submit" value="Submit Form" /> </form> Quote Link to comment Share on other sites More sharing options...
cactuscake Posted October 17, 2009 Author Share Posted October 17, 2009 Using onclick because the input type is an image... can't get into my host server at the moment to test a simple submit button but will try that as soon as I'm back in. uggh! Looks like the server has been down for several hours... I guess I'm going to have to wait until tomorrow to sort it out. Quote Link to comment 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.