Hi
I am trying to create a simple customer registration page which is linked to a MySQL database but I am having problems running the thing! The problem you will see from the error log below "Line 26"???
Error Log>
[Sat Mar 12 10:55:49 2005] [error] PHP Parse error: syntax error, unexpected T_STRING in c:\Apache\htdocs\adduser.php on line 26
Any ideas??
<html><head><title?Adding a User</title>
<style type="text/css">
<!--
.style2 {color: #993399}
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
body {
background-color: #FFFFFF;
margin-left: 1cm;
margin-right: 0cm;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body>
<div align="justify"><span class="style2"></span>
<?php $self = $SERVER['PHP_SELF'];
$telephoneno = $POST['telephoneno'];
$firstname = $POST['firstname'];
$lastname = $POST['lastname'];
$address = $POST['address'];
$email = $POST['email'];
$paytype = $POST['paytype'];
$cc no = $POST['cc no'];
$cc expiry = $POST['cc expiry'];
$cc start = $POST['cc start'];
$cc issue = $POST['cc issue'];
$a/c holder = $POST['a/c holder'];
$a/c no = $POST['a/c no'];
$s/code = $POST['s/code'];
$username = $POST['username'];
$password = $POST['password'];
if( ( !$telephoneno ) or ( !$firstname )
or ( !$lastname ) or ( !$address )
or ( !$email ) or ( !$paytpe )
or ( !$cc no ) or ( !$cc expiry )
or ( !$cc start ) or ( !$cc issue )
or ( !$a/c holder ) or ( !$a/c no )
or ( !$s/code ) or ( !$username )
or ( !$password) )
{
$form ="Please enter all new user details...";
$form.="<form action=\"$self\"";
$form.=" method=\"post\"text\">Telephone No: ";
$form.="<input type=\"text\" name=\"telephoneno\"";
$form.=" value=\"$telephoneno\"><br>First Name: ";
$form.="<input type=\"text\" name=\"firstname\"";
$form.=" value=\"$firstname\"><br>Last Name: ";
$form.="<input type=\"text\" name=\"lastname\"";
$form.=" value=\"$lastname\"><br>Address: ";
$form.="<input type=\"text\" name=\"address\"";
$form.=" value=\"$address\"><br>Email: ";
$form.="<input type=\"text\" name=\"email\"";
$form.=" value=\"$email\" ><br>Pay Type: ";
$form.="<input type=\"text\" name=\"paytype\"";
$form.=" value=\"$paytype\"><br>CC No: ";
$form.="<input type=\"text\" name=\"cc no\"";
$form.=" value=\"$cc no\"><br>CC Expiry: ";
$form.="<input type=\"text\" name=\"cc expiry\"";
$form.=" value=\"$cc expiry\" ><br>CC Start: ";
$form.="<input type=\"text\" name=\"cc start\"";
$form.=" value=\"$cc start\" ><br>CC Issue: ";
$form.="<input type=\"$cc issue\" name=\"cc issue\"";
$form.=" value=\"$cc issue\" ><br>A/c Holder: ";
$form.="<input type=\"text\" name=\"A/c Holder\"";
$form.=" value=\"$a/c holder\" ><br>A/c No: ";
$form.="<input type=\"text\" name=\"a/c no\"";
$form.=" value=\"$a/c no\" ><br>S/Code: ";
$form.="<input type=\"text\" name=\"s/code\"";
$form.=" value=\"$s/code\" ><br>Username: ";
$form.="<input type=\"text\" name=\"username\"";
$form.=" value=\"$username\" ><br>Password: ";
$form.="<input type=\"text\" name=\"password\"";
$form.=" value=\"$password\"><br>";
$form.="<input type=\"submit\" value=\"Submit\">";
$form.="</form>";
echo( $form );
}
else
{ $conn = @mysql_connect( "localhost", "rcox","joshua" )
or die("Could not connect to MySQL");
$db = mysql_select_db( "template", $conn )
or die("Could not select database");
$sql = "insert into users
(telephoneno,firstname,lastname,address,email,paytype,cc no,cc expiry,cc start,cc issue,a/c holder,a/c no,s/code,username,password) values
(\"$telephoneno\",\"$firstname\",\"$lastname\",\"$address\",\"$email\",\"$paytype\",\"$cc no\",\"$cc expiry\",\"$cc start\",\"$a/c holder\",\"$a/c no\",\"$s/code\",\"$username\",password(\"$password\") )";
$result = mysql_query( $sql, $conn )
or die("Could not execute query");
if( $result ) { echo( "New User $username added" ); }
}
?>
</div>
</body></html>