gamesmstr Posted September 15, 2008 Share Posted September 15, 2008 I have a standard login register page and for the life of me I can't get the form to pass variables. I've tried everything I can think of and no luck. See if any of you see my error. I attempt to view the data both before and after I "clean" it from possible injection attacks. And I get this: Email = , Username = , Password = , Vpassword = Email = '', Username = '', Password = '', Vpassword = '' Here is register.php <HTML> <BODY> <?php include('preloader.php'); include('header1.php'); ?> <FORM name="register" action="register2.php" method="post"> <P align=center> <TABLE cellSpacing=2 cellPadding=5 width=500 border=0> <TBODY> <TR> <TD width="30%"><FONT size=2><FONT color=#ff0000>*</FONT>Email Address:</FONT></TD> <TD><FONT size=2><INPUT type="text" maxLength=50 size=50 name="email"></FONT></TD></TR> <TR> <TD><FONT size=2><FONT color=#ff0000>*</FONT>User Name:</FONT></TD> <TD><FONT size=2><INPUT type=text maxLength=20 name=username></FONT></TD></TR> <TR> <TD><FONT size=2><FONT color=#ff0000>*</FONT>Password:</FONT></TD> <TD><FONT size=2><INPUT type=password maxLength=20 name=password></FONT></TD></TR> <TR> <TD><FONT size=2><FONT color=#ff0000>*</FONT>Verify Password:</FONT></TD> <TD><FONT size=2><INPUT type=password maxLength=20 name=vpassword></FONT></TD></TR> </TBODY></TABLE><BR> <INPUT type="submit" value="Register" name="submit"></P> </FORM> </BODY> </HTML> And here is register2.php <HTML> <HEAD> </HEAD> <BODY> <? include('preloader.php'); include('header1.php'); $email = $_post['email']; $username = $_post['username']; $password = $_post['password']; $vpassword = $_post['vpassword']; echo "Email = $email, Username = $username, Password = $password, Vpassword = $vpassword<BR>"; $email = clean($email); $username = clean($username); $password = clean($password); $vpassword = clean($vpassword); echo "Email = $email, Username = $username, Password = $password, Vpassword = $vpassword<BR>"; ?> </BODY> </HTML> Quote Link to comment Share on other sites More sharing options...
Psycho Posted September 15, 2008 Share Posted September 15, 2008 Use: $_POST Not: $_post Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 15, 2008 Share Posted September 15, 2008 And when learning php, developing php code, or debugging php code, set error_reporting to E_ALL and set display_errors to ON in your php.ini to get php to help you find problems like that one (stop and start your web server to get any changes made to php.ini to take effect.) Quote Link to comment Share on other sites More sharing options...
gamesmstr Posted September 15, 2008 Author Share Posted September 15, 2008 *smacks forehead* Doh! Thanks man....That has been driving me nuts for a few hours.... Quote Link to comment Share on other sites More sharing options...
gamesmstr Posted September 15, 2008 Author Share Posted September 15, 2008 And when learning php, developing php code, or debugging php code, set error_reporting to E_ALL and set display_errors to ON in your php.ini to get php to help you find problems like that one (stop and start your web server to get any changes made to php.ini to take effect.) Unfortunately I am developing on a remote host. I do not have access to the php.ini file. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 15, 2008 Share Posted September 15, 2008 You should set up a web server/php/mysql on your personal computer for development. Until code is completely tested it could contain security holes that would allow a hacker to take advantage of your remote server. If your remote server is running php as a CGI application, you can put the settings into a local php.ini. If your remote server is running php as an Apache module, you can set those values in a .htaccess file (the E_ALL needs to be converted to its' corresponding integer value.) For non-fatal parse errors you can put these settings in at the start of your script. 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.