dhmyers82 Posted March 2, 2015 Share Posted March 2, 2015 Please tell me if I am thinking correctly I have a .html doc with a form. The form has an action calling a php file. The action is called when I hit submit. How does it work with an all-in-one form? Why is the php running as the page loads and not when I hit submit? Link to comment https://forums.phpfreaks.com/topic/295023-html-forms-submit-button/ Share on other sites More sharing options...
mac_gyver Posted March 2, 2015 Share Posted March 2, 2015 this and your last 3 threads have been posted in the wrong forum section, requiring someone on the staff to move them. the Php Regex form section is for help with regular expressions, i.e. pattern matching. it is not for other types of programming questions. Link to comment https://forums.phpfreaks.com/topic/295023-html-forms-submit-button/#findComment-1507272 Share on other sites More sharing options...
Ch0cu3r Posted March 2, 2015 Share Posted March 2, 2015 I have a .html doc with a form. The form has an action calling a php file. The action is called when I hit submit. Correct. How does it work with an all-in-one form? What do you mean by this? Link to comment https://forums.phpfreaks.com/topic/295023-html-forms-submit-button/#findComment-1507273 Share on other sites More sharing options...
dhmyers82 Posted March 2, 2015 Author Share Posted March 2, 2015 Sorry, where would you like me to post questions like this? Link to comment https://forums.phpfreaks.com/topic/295023-html-forms-submit-button/#findComment-1507274 Share on other sites More sharing options...
dhmyers82 Posted March 2, 2015 Author Share Posted March 2, 2015 When it is a .php file with a form and the action calls itself. The validations are running before the user even has a chance to enter in any data. I just reread the question and I think they should be separate files with all the data being appended to a "single" .txt file Link to comment https://forums.phpfreaks.com/topic/295023-html-forms-submit-button/#findComment-1507275 Share on other sites More sharing options...
Ch0cu3r Posted March 2, 2015 Share Posted March 2, 2015 When it is a .php file with a form and the action calls itself. The validations are running before the user even has a chance to enter in any data. Not at all. PHP is only executed when a request is sent to the server, ie the user clicks a link, submits a form. Link to comment https://forums.phpfreaks.com/topic/295023-html-forms-submit-button/#findComment-1507277 Share on other sites More sharing options...
mac_gyver Posted March 2, 2015 Share Posted March 2, 2015 you need logic in your code to detect that the form was submitted and only use the submitted data when it has. Link to comment https://forums.phpfreaks.com/topic/295023-html-forms-submit-button/#findComment-1507278 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.