B
ben
Guest
Ok. This is my html coding...its very basic...
<html>
<head>
<title>Mailster</title>
</head>
<body>
<form name="register" type="post" action="Account/Register.php">
Username: <input type="text" name="username1" />
<br />
Password: <input type="text" name="password1" />
<br />
<input type="submit" name="register" value="Register" />
</form>
</body>
</html>
Now, here is my PHP coding.
<?php
$username =
$password = $_POST["password1"];
$databaseusername = "root";
$databasepassword = "";
$createemailaccount = $username;
$con = mysql_connect(localhost,$databaseusername,$databasepassord);
$continueregister = "CREATE TABLE deleted (From varchar(256) NOT NULL,Subject varchar(256) NOT NULL,Date varchar(256) NOT NULL)";
echo $_REQUEST['username1'];
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (mysql_query("CREATE DATABASE $username",$con))
{
mysql_query($continueregister);
echo "Database created!";
}
else
{
echo "Error creating database: " . mysql_error();
}
mysql_close($con);
?>
I need help. How do I store whatever is typed from the form named "username1" into the variable $username in the PHP file?
Thank you!
Thank you! It worked!!!
<html>
<head>
<title>Mailster</title>
</head>
<body>
<form name="register" type="post" action="Account/Register.php">
Username: <input type="text" name="username1" />
<br />
Password: <input type="text" name="password1" />
<br />
<input type="submit" name="register" value="Register" />
</form>
</body>
</html>
Now, here is my PHP coding.
<?php
$username =
$password = $_POST["password1"];
$databaseusername = "root";
$databasepassword = "";
$createemailaccount = $username;
$con = mysql_connect(localhost,$databaseusername,$databasepassord);
$continueregister = "CREATE TABLE deleted (From varchar(256) NOT NULL,Subject varchar(256) NOT NULL,Date varchar(256) NOT NULL)";
echo $_REQUEST['username1'];
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
if (mysql_query("CREATE DATABASE $username",$con))
{
mysql_query($continueregister);
echo "Database created!";
}
else
{
echo "Error creating database: " . mysql_error();
}
mysql_close($con);
?>
I need help. How do I store whatever is typed from the form named "username1" into the variable $username in the PHP file?
Thank you!
Thank you! It worked!!!