Jump to content

Form is not passing variables....


gamesmstr

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/124305-form-is-not-passing-variables/
Share on other sites

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.)

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.

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.