I'm trying to capture data from a members registration form and insert this into a MySQL database using PHP but keep getting errors although the code seems to read OK.
I can echo values from the database and get no connection errors so it has to be the data insertion portion of the code that's incorrect. Can anyone help with this...?
The error message I receive makes no sense either:
That line is actually a closing HTML TAG.
Any help would be greatly appreciated.
-----------------------
Michael Mason
-----------------------
I can echo values from the database and get no connection errors so it has to be the data insertion portion of the code that's incorrect. Can anyone help with this...?
<?php
/* MySQL Connection Variables */
$host="localhost";
$user="arras_WebMaster";
$password="qwerty";
$dbase="arras_Members";
/* MySQL Connection String */
$Connection=mysql_connect ("$host", "$user", "$password")
or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("$dbase");
echo "database status: alive";
/* User Registration Form */
echo "<form action = '??????????.php' method='POST'>";
echo "<pre>UserID: \t\t<input type = 'text' name = 'TXT_UserID'></pre>";
echo "<br>";
echo "<pre>Password: \t \t<input type = 'text' name = 'TXT_UserPassword'></pre>";
echo "<br>";
echo "<pre>a little about me: \t<input type = 'text' name = 'TXT_Comments'></pre>";
echo "<br>";
echo "<pre>more about me: \t<input type = 'text' name = 'TXT_FurtherComments'></pre>";
echo "<br>";
echo "<pre>\t\t\t<input type='submit' value='Submit Details'<pre>";
echo "</form>";
/* Data Insertion */
$NewUserID= $_POST['TXT_UserID'];
$NewUserPassword= $_POST['TXT_UserPassword'];
$NewUserComments= $_POST['TXT_Comments'];
$NewUserFurtherComments=$_POST['TXT_FurtherComments'];
$sql = "INSERT INTO RegisteredMembers (TXT_UserID,TXT_UserPassword,TXT_Comments,TXT_FurtherComments)"
VALUES('$NewUserID','$NewUserPassword','$NewUserComments','$NewUserFurtherComments');
?>
The error message I receive makes no sense either:
Parse error: parse error, unexpected '[' in /home/arras/public_html/members/Register.php on line 69
That line is actually a closing HTML TAG.
Any help would be greatly appreciated.
-----------------------
Michael Mason
-----------------------