speedy33417 Posted September 12, 2006 Share Posted September 12, 2006 First time posting here. New to php. ;DI'm trying to use sessions for an html form to process user ID and password. index.php receives two variables that need to be global variables which will be carried over to loggedin.php and verified either invalid user id and/or password or access to that page.My problem is the first half: index.phpThis is what I have so far:[code]<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <link rel="stylesheet" type="text/css" href="inc/theme.css"> </head> <body leftmargin="0" rightmargin="0" bottommargin="0" topmargin="0" marginheight="0" marginwidth="0"> <form name="logForm" action="loggedin.php"> <div align="center"> <table border="0" width="610" cellpadding="0" cellspacing="0"> <tr> <td width="105" valign="top"><span class="text1"> user ID</span></td> <td width="105" valign="top"><span class="text1"> password</span></td> <td width="400"></td> </tr> <tr> <td width="105" valign="top"><input name="userId" class="form3"></td> <td width="105" valign="top"><input name="passWord" class="form3"></td> <td width="400" valign="bottom"><a href="javascript:if(document.logForm.onsubmit())document.logForm.submit()" class="text1">Log in</a></td> </tr> </table> </div> </form> </body> </html> [/code]I need help inserting the session for those variables so after submitting, they can be called with a session_start on loggedin.php. Link to comment https://forums.phpfreaks.com/topic/20566-sessionsforms/ Share on other sites More sharing options...
gijew Posted September 12, 2006 Share Posted September 12, 2006 All I see is some HTML. Are you trying to verify the user on the same page or are you passing it to another page? I'm kind of confused as to where you're going with this. From what I get you're trying to have verify a user but I didn't see any code that indicates anything but displaying a form = / Link to comment https://forums.phpfreaks.com/topic/20566-sessionsforms/#findComment-90765 Share on other sites More sharing options...
speedy33417 Posted September 13, 2006 Author Share Posted September 13, 2006 I was going to get it verified on the next page, but now that you ask me is it possible to do it on the same page?But getting back to the way I wanted to do it. I hear about all these super globals at what not. I wanted to make sure that my first page is all done before I worry about the second one.Do I need to start a session on index.php or it's good as is? Link to comment https://forums.phpfreaks.com/topic/20566-sessionsforms/#findComment-90784 Share on other sites More sharing options...
PigsHidePies Posted September 13, 2006 Share Posted September 13, 2006 Yea, its possible to do it on the same page, just have to put the form and the variables above the actual php code else you'll get an error since the user hasn't given any info yet. I recommend you start a session at the top of all your pages since you are going to be using sessions. That way, if someone is already logged in, you can have the page display somtehing else besides letting him signup again.ex: <?php session_start(); ?><html>etc</html> Link to comment https://forums.phpfreaks.com/topic/20566-sessionsforms/#findComment-90873 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.