Got this error now:
Parse error: parse error in /opt/apache/htdocs/newclient.php on line 49
(49th row is "extract $row")
Here is the first 49+ lines of the form page followed by results page (if needed):
<head>
<title>4i dotCom - New Client Entry</title>
<STYLE TYPE="text/css">
H1 {
font-weight: bold;
font-size: 12pt;
line-height: 12pt;
font-family: verdana;
font-variant: normal;
font-style: normal;
}
BODY {
color: black;
background-color: white;
background-image:src="manual/images/4i_Logo.gif";
background-repeat: no-repeat;
font-family:verdana;
font-variant: normal;
font-style: normal;
font-weight: normal;
font-size: 10pt;
line-height: 11pt;
}
</STYLE>
</head>
<align="left"><IMG SRC="manual/images/4i_Logo.gif" ALT="4i Logo" BORDER=0>
<body>
<h1>4i dotCom - New Client Entry</h1>
<form action="http://localhost/insert_client.php" method="post">
<table border=0 font-size=8>
<tr><td><font=8>Industry</font></td><td>
<?
$db = @mysql_pconnect("localhost.localdomain:3306", "root", "password");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("4i_dotCom");
$results = mysql_query("SELECT IndName FROM Industry ORDER BY IndName");
echo '<select name="IndName">';
while( $row = mysql_fetch_array($results)){
extract $row;
echo "<option>$IndName\n";
}
echo '</select>';
?>
HERE IS RESULTS PAGE:
<head>
<title>4i dotCom Entry Results</title>
</head>
<body>
<h1>4i dotCom Entry Results</h1>
<?
if (!$ClientName || !$ClientStNo || !$ClientStName || !$ClientPostCode || !$AreaCode || !$MainPhone || !$MainFax || !$MainEmail || !$MainContact || !$ConsultantID)
{
echo "You have not entered all the required details.<br>"
."Please go back and try again.";
exit;
}
$ClientID = addslashes($ClientID);
$ClientName = addslashes($ClientName);
$ClientBldgName = addslashes($ClientBldgName);
$ClientStNo = addslashes($ClientStNo);
$ClientStName = addslashes($ClientStName);
$ClientStType = addslashes($ClientStType);
$ClientDistName = addslashes($ClientDistName);
$ClientCityName = addslashes($ClientCityName);
$ClientPostCode = addslashes($ClientPostCode);
$ClientCountry = addslashes($ClientCountry);
$AreaCode = addslashes($AreaCode);
$MainPhone = doubleval($MainPhone);
$MainFax = doubleval($MainFax);
$MainEmail = addslashes($MainEmail);
$MainContact = addslashes($MainContact);
$Comments = addslashes($Comments);
$MainContact = addslashes($MainContact);
$ConsultantID = doubleval($ConsultantID);
$db = @mysql_pconnect("localhost.localdomain:3306", "root", "password");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("4i_dotCom");
$query = "insert into Clients (ClientID, ClientName, ClientBldgName, ClientStNo, ClientStName,
ClientDistName, ClientCityName, ClientPostCode, ClientCountry, Industry, AreaCode, MainPhone, MainFax,
MainEmail, MainContact, Comments, ConsultantID, ClientStType) values
('".ClientID."', '".$ClientName."', '".$ClientBldgName."', '".$ClientStNo."', '".$ClientStName."',
'".$ClientDistName."', '".$ClientCityName."', '".$ClientPostCode."', '".$ClientCountry."',
'".$Industry."', '".$AreaCode."', '".$MainPhone."', '".$MainFax."', '".$MainEmail."', '".$MainContact."', '".$Comments."', '".$ConsultantID."', '".ClientStType."')";
$result = mysql_query($query) or die("Error: ".mysql_error());
if ($result)
echo mysql_affected_rows()." client inserted into database.";
?>
</body>