A
Anonymous
Guest
I've got a error
arse error: parse error, unexpected ';' in /home/symphon1/public_html/add_user_record.php on line 26
Can someone help me?
Here are codes:
<?php require_once('../Connections/filmmaker.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "userform")) {
$insertSQL = sprintf("INSERT INTO filmmakers (`first`, `last`, address, city, `state`, zip, country, bio, email) VALUES (firstName, lastName, address, city, state, country, bio, email)",
GetSQLValueString($HTTP_POST_VARS['firstName'], "text"),
GetSQLValueString($HTTP_POST_VARS['lastName'], "text"),
GetSQLValueString($HTTP_POST_VARS['address'], "text"),
GetSQLValueString($HTTP_POST_VARS['city'], "text"),
GetSQLValueString($HTTP_POST_VARS['state'], "text"),
GetSQLValueString($HTTP_POST_VARS['zip'], "int"),
GetSQLValueString($HTTP_POST_VARS['country'], "text"),
GetSQLValueString($HTTP_POST_VARS['bio'], "text"),
GetSQLValueString($HTTP_POST_VARS['email'], "text"));
mysql_select_db($database_filmmaker, $filmmaker);
$Result1 = mysql_query($insertSQL, $filmmaker) or die(mysql_error());
$insertGoTo = "/public_html/user_record_details.php?email=".$HTTP_POST_VAR['email']."";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<?php echo "<?xml version=\"1.0\" encoding=\"big5\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>add_user_record</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<script language="JavaScript" type="text/JavaScript">
</script>
</head>
<body>
<center>
<p>Add a User Record</p>
<p>Fill in the form below, with your name and address detail,<br />
to add your record to our system</p>
<form name="userform" id="userform" method="POST" action="<?php echo $editFormAction; ?>">
<table width="60%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td width="34%" align="right">First Name:</td>
<td width="66%"> <input name="firstName" type="text" id="firstName" onFocus="MM_displayStatusMsg('Please enter your First Name');return document.MM_returnValue" maxlength="30" /></td>
</tr>
<tr>
<td align="right">Last Name:</td>
<td> <input name="lastName" type="text" id="lastName" onFocus="MM_displayStatusMsg('Please enter your Last Name');return document.MM_returnValue" maxlength="30" /></td>
</tr>
<tr>
<td align="right">Address 1:</td>
<td> <input name="address" type="text" id="address" onFocus="MM_displayStatusMsg('Please enter address');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">Address 2:</td>
<td> <input name="address" type="text" id="address" onFocus="MM_displayStatusMsg('Please enter address');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">City:</td>
<td> <input name="city" type="text" id="city" onFocus="MM_displayStatusMsg('Please enter City');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">State:</td>
<td> <input name="state" type="text" id="state" onBlur="MM_displayStatusMsg('Please enter State');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">Zip:</td>
<td> <input name="zip" type="text" id="zip" onFocus="MM_displayStatusMsg('Please enter Zip');return document.MM_returnValue" maxlength="20" /></td>
</tr>
<tr>
<td align="right">Country:</td>
<td> <select name="country" id="country" onFocus="MM_displayStatusMsg('Please select a Country');return document.MM_returnValue">
<option value="USA">USA</option>
<option value="GERMANY">GERMANY</option>
<option value="SPAIN">SPAIN</option>
<option value="FRANCE">FRANCE</option>
<option value="ENGLAND">ENGLAND</option>
</select></td>
</tr>
<tr>
<td align="right">Bio:</td>
<td> <textarea name="bio" rows="10" id="bio" onFocus="MM_displayStatusMsg('Please input your bio');return document.MM_returnValue"></text></td>
</tr>
<tr>
<td align="right">Email:</td>
<td> <input name="email" type="text" id="email" onBlur="MM_displayStatusMsg('Please enter email address');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">Thumb:</td>
<td> </td>
</tr>
<tr>
<td align="right"> </td>
<td>
<input name="addmyrecord" type="submit" onClick="MM_validateForm('firstName','','R','lastName','','R','0','','R','1','','R','city','','R','state','','R','zip','','R','email','','RisEmail','textarea','','R');return document.MM_returnValue" value="Add My Record" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="userform">
</form>
<p> </p>
</center>
</body>
</html>
Can someone help me?
Here are codes:
<?php require_once('../Connections/filmmaker.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "userform")) {
$insertSQL = sprintf("INSERT INTO filmmakers (`first`, `last`, address, city, `state`, zip, country, bio, email) VALUES (firstName, lastName, address, city, state, country, bio, email)",
GetSQLValueString($HTTP_POST_VARS['firstName'], "text"),
GetSQLValueString($HTTP_POST_VARS['lastName'], "text"),
GetSQLValueString($HTTP_POST_VARS['address'], "text"),
GetSQLValueString($HTTP_POST_VARS['city'], "text"),
GetSQLValueString($HTTP_POST_VARS['state'], "text"),
GetSQLValueString($HTTP_POST_VARS['zip'], "int"),
GetSQLValueString($HTTP_POST_VARS['country'], "text"),
GetSQLValueString($HTTP_POST_VARS['bio'], "text"),
GetSQLValueString($HTTP_POST_VARS['email'], "text"));
mysql_select_db($database_filmmaker, $filmmaker);
$Result1 = mysql_query($insertSQL, $filmmaker) or die(mysql_error());
$insertGoTo = "/public_html/user_record_details.php?email=".$HTTP_POST_VAR['email']."";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<?php echo "<?xml version=\"1.0\" encoding=\"big5\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>add_user_record</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<script language="JavaScript" type="text/JavaScript">
</script>
</head>
<body>
<center>
<p>Add a User Record</p>
<p>Fill in the form below, with your name and address detail,<br />
to add your record to our system</p>
<form name="userform" id="userform" method="POST" action="<?php echo $editFormAction; ?>">
<table width="60%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td width="34%" align="right">First Name:</td>
<td width="66%"> <input name="firstName" type="text" id="firstName" onFocus="MM_displayStatusMsg('Please enter your First Name');return document.MM_returnValue" maxlength="30" /></td>
</tr>
<tr>
<td align="right">Last Name:</td>
<td> <input name="lastName" type="text" id="lastName" onFocus="MM_displayStatusMsg('Please enter your Last Name');return document.MM_returnValue" maxlength="30" /></td>
</tr>
<tr>
<td align="right">Address 1:</td>
<td> <input name="address" type="text" id="address" onFocus="MM_displayStatusMsg('Please enter address');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">Address 2:</td>
<td> <input name="address" type="text" id="address" onFocus="MM_displayStatusMsg('Please enter address');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">City:</td>
<td> <input name="city" type="text" id="city" onFocus="MM_displayStatusMsg('Please enter City');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">State:</td>
<td> <input name="state" type="text" id="state" onBlur="MM_displayStatusMsg('Please enter State');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">Zip:</td>
<td> <input name="zip" type="text" id="zip" onFocus="MM_displayStatusMsg('Please enter Zip');return document.MM_returnValue" maxlength="20" /></td>
</tr>
<tr>
<td align="right">Country:</td>
<td> <select name="country" id="country" onFocus="MM_displayStatusMsg('Please select a Country');return document.MM_returnValue">
<option value="USA">USA</option>
<option value="GERMANY">GERMANY</option>
<option value="SPAIN">SPAIN</option>
<option value="FRANCE">FRANCE</option>
<option value="ENGLAND">ENGLAND</option>
</select></td>
</tr>
<tr>
<td align="right">Bio:</td>
<td> <textarea name="bio" rows="10" id="bio" onFocus="MM_displayStatusMsg('Please input your bio');return document.MM_returnValue"></text></td>
</tr>
<tr>
<td align="right">Email:</td>
<td> <input name="email" type="text" id="email" onBlur="MM_displayStatusMsg('Please enter email address');return document.MM_returnValue" maxlength="100" /></td>
</tr>
<tr>
<td align="right">Thumb:</td>
<td> </td>
</tr>
<tr>
<td align="right"> </td>
<td>
<input name="addmyrecord" type="submit" onClick="MM_validateForm('firstName','','R','lastName','','R','0','','R','1','','R','city','','R','state','','R','zip','','R','email','','RisEmail','textarea','','R');return document.MM_returnValue" value="Add My Record" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="userform">
</form>
<p> </p>
</center>
</body>
</html>