Hey guys,
Hoping someone can help me out. On my linode I have mysql, php & apache, and im trying to write a script to pull info from my database, but I keep getting this error:
Quote:
PHP Parse error: syntax error, unexpected T_LOGICAL_OR in /var/www/vhosts/xxx.net/httpdocs/Tim/dbconnect.php on line 24, referer:
http://xxx.net/Tim/Registration.htm
Heres the script:
Code:
<?php
//set database connection variables
$host='localhost';
$dbuser='xxx';
$dbpass='xxx';
$dbname='xxx';
$connection = mysql_connect($host, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db($dbname) or die(mysql_error());
require('dbconnect.php');
if($_POST['submit']) {
$firstname = $_POST['firstname'];
$middlename = $_POST['middlename'];
$lastname = $_POST['lastname'];
$sex = $_POST($sex);
$emailaddress = $_POST['emailaddress'];
if((empty($firstname)) OR (empty($middlename)) OR (empty($lastname)) OR (empty($sex)) OR (empty($sex)))
{
echo "Please fill in all fields!";
}
if (empty($you)) OR (empty($others));
{
echo "Please agree to both terms or you cannot be a member! (All members are bound by these terms and if they violate them their membership will be revoked.)";
}
else {
$query = "INSERT INTO ifdbt0 (memberid, firstname, middlename, lastname, sex, emailaddress) VALUES ('', '$firstname', '$middlename', '$lastname', '$sex', '$emailaddress;)";
mysql_query($query) or die(mysql_error());
echo "Thank you for your registration $firstname $middlename $lastname! You are now an official member of the Inspiration Foundation.";
}
mysql_close($connection);
?>
But I cant figure out the prob :/ Can anyone help?
Kind Regards,
Justin
____
Edit by Jed Smith: Removed database credentials.