Alright, to expand my knowledge in PHP, i want to attempt to make a usersystem.
I am currently making a registration code, and I have the following:
You can view the script here: www.roflhabbos.com/dev/register2.phpPHP Code:<?php
//The Variables
$name = $_POST[name];
$password = $_POST[password];
$email - $_POST[email];
$age = $_POST[age];
$submit = $_POST[submit];
//The IFs
if($submit !=""){
if($name !=""){
echo "Whoops! You didn't enter a username. You need that if you want to login!";
}
elseif($password !=""){
echo "Whoops! You didn't enter a password. You need this to login to your account as well as security for your account!";
}
elseif($email !=""){
echo "Whoops! You didn't enter an email. You need this to receive news and updates for the usersystem, as well as to verify your identity.";
}
elseif($age !=""){
echo "Whoops! You didn't enter your age. We need this to verify you are old enough to register!";
}
echo "Heya, $name - Welcome to $site. The details you used to sign up are as follows:<br>
Name: $name<br>
Email: $email<br>
Age: $age<br>
<br>
If the details are incorrect, use the back button and try again. If they are correct, please continue to the installer.";
}
// The HTML
echo "<form action=\"register2.php\" method=\"post\">
Username: <input type=\"text\" name\"name\"><br>
Password: <input type=\"text\" name\"password\"><br>
Email: <input type=\"text\" name=\"email\"><br>
Age: <input type=\"text\" name=\"age\"><br>
<input type=\"submit\" name=\"submit\" value=\"Submit\">
</form>";
?>
It shows me things I don't want it to, such as: " Whoops! You didn't enter your age. We need this to verify you are old enough to register!" when I did enter an age. It also doesnt show the variable I entered, it only shows what I entered for $age.
Any help?






Reply With Quote




