Hello,
I'm trying to create a html/php form.
If I leave the code as is posted below I receive a "METHOD NOT ALLOWED" message.
However, if I seperate the html/php and submit the output to a php file thats included in the <form action="some.php"> it works fine
I would prefer not to seperate the two so it's all self contained. Any suggestions?
Thanks
<?php
$first = $POST['first'];
$last = $POST['last'];
$password = $POST['password'];
$email = $POST['email'];
$link = mysql_connect("localhost", "username", "password")
or die("Could not connect");
mysql_select_db("db") or die("Could not select database");
$query "INSERT INTO users set alias = '$alias', first = '$first', last = '$last', email = '$email', accessID = '$group'";
mysql_query( $query, $link );
$query1 "SELECT userID FROM users WHERE alias = '$alias'";
$result1 = mysql_query($query1);
while ($row = mysql_fetch_assoc($result1)){
$ID = $row["user_last"];
}
$query2 "INSERT INTO passwd SET userID = '$ID', pass = password('$password')";
mysql_query( $query2, $link );
?>
<html>
<head>
<title>Add User</title>
</head>
<body>
<form method=post>
<input type="text" name="alias"> Username
<br>
<input type="text" name="first"> First Name
<br>
<input type="text" name="last"> Last Name
<br>
<input type="text" name="email"> Email address
<br>
<input type="text" name="password"> Password
<br>
<input type="submit" value="submit">
</form>
</body>
</html>