I have a script that allows users to register for my website ( kevtek.uuuq.com ) and I'm having trouble with one variable it seems. As a diagnostic tool the script currently simply reports the contents of the fields plus a few other variables that will be passed ultimately to the MySQL database. Also, I didn't want visitors to see an error page so I allowed them to participate in the development of the script as I work on it. This is actually the purpose of my site - developing website content and code. You can go directly to my registration page to get a more clear idea of what I'm talking about here.
I develop my pages and code on my local system using WAMP (Windows Apache MySQL and PHPAdmin) - very handy - then FTP my files to the uuuq server. My code works on the local server but the variable is dropped on the uuuq server for some reason.
Depending on the state of the "Usage Statement" checkbox the variable should contain either "on" if checked, and blank or empty for unchecked. Here is the html statement for my checkbox:
CODE
<td id="reg_fields">
<input type="checkbox" name="reg_agree" /> Check here Please
</td>
<input type="checkbox" name="reg_agree" /> Check here Please
</td>
Here is the relevant PHP code, I've snipped out things that would just clutter the codebox up. If people think that posting the whole script is required I'll certainly be happy to oblige.
CODE
<?php
// Assign form variables
$username = $_POST['reg_user'];
$password1 = $_POST['reg_pswd1'];
$password2 = $_POST['reg_pswd2'];
$email1 = $_POST['reg_mail1'];
$email2 = $_POST['reg_mail2'];
$dob_month = $_POST['dob_month'];
$dob_day = $_POST['dob_day'];
$dob_year = $_POST['dob_year'];
$agree = $_POST['reg_agree'];
// ...snip...
// Display data
// Other variables are displayed as well - they were omitted
echo "Usage Agreement Raw : " . $agree . "<br />";
echo "Usage Agreement : ";
// Translate value
if ($agree == "on") {
echo "Yes";
} else {
echo "No";
}
echo "<br />";
?>
// Assign form variables
$username = $_POST['reg_user'];
$password1 = $_POST['reg_pswd1'];
$password2 = $_POST['reg_pswd2'];
$email1 = $_POST['reg_mail1'];
$email2 = $_POST['reg_mail2'];
$dob_month = $_POST['dob_month'];
$dob_day = $_POST['dob_day'];
$dob_year = $_POST['dob_year'];
$agree = $_POST['reg_agree'];
// ...snip...
// Display data
// Other variables are displayed as well - they were omitted
echo "Usage Agreement Raw : " . $agree . "<br />";
echo "Usage Agreement : ";
// Translate value
if ($agree == "on") {
echo "Yes";
} else {
echo "No";
}
echo "<br />";
?>
Again, the script works fine on my local system but drops this variable on the uuuq server. Perhaps I am missing something...
You can look at the site via the links above - this may help clarify what I'm trying to express. Fill out the form (don't use your real passwords of course) and hit the "Register" button to see what is going on. If anyone has an idea what I've done or not done I'd appreciate the assist. Thanks in advance.
Kev
