I am getting a Parse error that states:
Parse error: parse error, unexpected $ in /home/httpd/vhosts/carnfo.com/httpdocs/edit.php3 on line 150
I have tried a ton of different things which is why there might be a little too much php than needed, but i cant figure out whats wrong. Please help.
<html>
<head>
<title>Edit Member Ride - Carnfo.com</title>
<SCRIPT language="JavaScript">
<!-- to hide script contents from old browsers
function VerifyData() {
var valid = 1
if (document.Member.fn.value == "") {
valid = 0
}
if (document.Member.ln.value == "") {
valid = 0
}
if (document.Member.email.value == "") {
valid = 0
}
if (document.Member.cs.value == "") {
valid = 0
}
if (document.Member.year.value == "") {
valid = 0
}
if (document.Member.make.value == "") {
valid = 0
}
if (document.Member.model.value == "") {
valid = 0
}
if (document.Member.trim.value == "") {
valid = 0
}
if (document.Member.pw.value == "") {
valid = 0
}
// Here we decide whether to submit the form.
if (!valid) {
alert("Please complete all required fields");
return false
} else {
return true
}
return valid
}
// end hiding contents from old browsers -->
</SCRIPT>
</head>
<body>
<table>
<?php
$dbcnx = @mysql_connect("blah", "blah", "blah"); if (!$dbcnx) { echo( "<p>Unable to connect to the " . "database server at this time.</p>" ); exit(); }
if (! @mysql_select_db("carnfo") ) {
echo( "<p>Unable to locate the car information " .
"database at this time.</p>" );
exit();
}
if (!$num) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
} else {
$result = @("SELECT FROM mr WHERE email = '$email' AND pw = '$pw'");
if (!$result) {
echo("<p>Incorrect Password. Please go back and try again.</p>");
exit();
}
$row = mysql_fetch_array($result);
$num = $row['num'];
$fn = $row['fn'];
$ln = $row['ln'];
$email = $row['email'];
$cs = $row['cs'];
$year = $row['year'];
$make = $row['make'];
$model = $row['model'];
$trim = $row['trim'];
$pic1 = $row['pic1'];
$pic2 = $row['pic2'];
$pic3 = $row['pic3'];
$pic4 = $row['pic4'];
$pic5 = $row['pic5'];
$pic6 = $row['pic6'];
$pic1text = $row['pic1text'];
$pic2text = $row['pic2text'];
$pic3text = $row['pic3text'];
$pic4text = $row['pic4text'];
$pic5text = $row['pic5text'];
$pic6text = $row['pic6text'];
$pw = $row['pw'];
echo("<form action='<?=$PHP_SELF?>' method='post' name='Member' onSubmit='return VerifyData()'>");
echo("<tr><td>First Name:</td><td><input type=text name='fn' value='$fn'></td></tr>");
echo("<tr><td>Last Name:</td><td><input type=text name='ln' value='$ln'></td></tr>");
echo("<tr><td>Email:</td><td><input type=text name='email' value='$email'></td></tr>");
echo("<tr><td>City/State:</td><td><input type=text name='cs' value='$cs'></td></tr>");
echo("<tr><td>Password:</td><td><input type=password name='pw' value='$pw'></td></tr>");
echo("<tr><td>Year:</td><td><input type=text name='year' value='$year'></td></tr>");
echo("<tr><td>Make:</td><td><input type=text name='make' value='$make'></td></tr>");
echo("<tr><td>Model:</td><td><input type=text name='model' value='$model'></td></tr>");
echo("<tr><td>Trim:</td><td><input type=text name='trim' value='$trim'>*</td></tr>");
echo("<tr><td>Mods:</td><td><textarea name='mods' rows='5' cols='40' wrap value='$mods'></textarea></td></tr>");
echo("<tr><td>Picture URL:</td><td><input type=text name='pic1' value='$pic1'></td></tr>");
echo("<tr><td>Picture Desc.:</td><td><input type=text name='pic1text' value='$pic1text'></td></tr>");
echo("<tr><td>Picture URL:</td><td><input type=text name='pic2' value='$pic2'></td></tr>");
echo("<tr><td>Picture Desc.:</td><td><input type=text name='pic2text' value='$pic2text'></td></tr>");
echo("<tr><td>Picture URL:</td><td><input type=text name='pic3' value='$pic3'></td></tr>");
echo("<tr><td>Picture Desc.:</td><td><input type=text name='pic3text' value='$pic3text'></td></tr>");
echo("<tr><td>Picture URL:</td><td><input type=text name='pic4' value='$pic4'></td></tr>");
echo("<tr><td>Picture Desc.:</td><td><input type=text name='pic4text' value='$pic4text'></td></tr>");
echo("<tr><td>Picture URL:</td><td><input type=text name='pic5' value='$pic5'></td></tr>");
echo("<tr><td>Picture Desc.:</td><td><input type=text name='pic5text' value='$pic5text'></td></tr>");
echo("<tr><td>Picture URL:</td><td><input type=text name='pic6' value='$pic6'></td></tr>");
echo("<tr><td>Picture Desc.:</td><td><input type=text name='pic6text' value='$pic6text'></td></tr>");
echo("<tr><td><input type='submit' name='submit' value='SUBMIT'></td></tr>");
echo("</form>");
echo("</table>");
if ($submit == "SUBMIT") {
$sql = "UPDATE mr SET
fn='$fn',
ln='$ln',
email='$email',
cs='$cs',
year='$year',
make='$make',
model='$model',
trim='$trim',
mods='$mods',
pic1='$pic1',
pic1text='$pic1text',
pic2='$pic2',
pic2text='$pic2text',
pic3='$pic3',
pic3text='$pic3text',
pic4='$pic4',
pic4text='$pic4text',
pic5='$pic5',
pic5text='$pic5text',
pic6='$pic6',
pic6text='$pic6text',
pw='$pw'
WHERE num=$num";
if (@($sql)) {
echo("<script language='JavaScript'>");
echo("document.write = alert('Car Edited Successfully');");
echo("document.location='http://www.carnfo.com/member.php3';");
echo("</script>");
} else {
echo("<script language='JavaScript'>");
echo("document.write = alert('Error Editing Submitted Car: " . mysql_error() . "');");
echo("</script>");
}
}
?>