Natefons Posted July 1, 2008 Share Posted July 1, 2008 well i already know how to..(sort of) <form action=(file you will execute the contents of the form )> now thats how i know how to execute the info in a form (i.e a login form) my question is, how can i get the execution to occur IN the same file as the form i.e if the form is in http://mysite.com/login.php how do i ensure, that the login process occurs in this same file rather than mysite.com/(name of another file).php sorry if my explanation is hard to understand. Link to comment https://forums.phpfreaks.com/topic/112716-how-to-execute-a-form/ Share on other sites More sharing options...
interpim Posted July 1, 2008 Share Posted July 1, 2008 use sessions... check at the beginning of the file if a session exists for that user, if not display the login form. Link to comment https://forums.phpfreaks.com/topic/112716-how-to-execute-a-form/#findComment-578841 Share on other sites More sharing options...
MasterACE14 Posted July 1, 2008 Share Posted July 1, 2008 it is alittle hard to understand, but I believe interpim has the right idea about your user management system I think? Link to comment https://forums.phpfreaks.com/topic/112716-how-to-execute-a-form/#findComment-578858 Share on other sites More sharing options...
Bendude14 Posted July 1, 2008 Share Posted July 1, 2008 if you want the same page to process the form then just leave the action empty like this action="" Then the page will try to process the form itself.. Link to comment https://forums.phpfreaks.com/topic/112716-how-to-execute-a-form/#findComment-578868 Share on other sites More sharing options...
Natefons Posted July 1, 2008 Author Share Posted July 1, 2008 ok thanks, but how would i process the form? i.e if i want to insert into mysql the form detail, i would do $_post , would it be the same? Link to comment https://forums.phpfreaks.com/topic/112716-how-to-execute-a-form/#findComment-579245 Share on other sites More sharing options...
revraz Posted July 1, 2008 Share Posted July 1, 2008 You check if it's been submitted. Link to comment https://forums.phpfreaks.com/topic/112716-how-to-execute-a-form/#findComment-579247 Share on other sites More sharing options...
Bendude14 Posted July 2, 2008 Share Posted July 2, 2008 something like this will tell you if the form has been sent if(array_key_exists('send', $_POST)) { //code to process the form } This presumes your submit button is called send and your using $_POST Link to comment https://forums.phpfreaks.com/topic/112716-how-to-execute-a-form/#findComment-579693 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.