Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse Error

Status
Not open for further replies.

about2flip

Technical User
Nov 21, 2003
31
US
I am getting a parse error '<' on Line 7. I can not see it. Can someone help me out and tell me where it is.

<?
$page_title ="EXDQ TRUCKING ADMIN";
include ('includes/header.html');
?>
<h1 id="mainhead">Expedited Trucking Admin</h1>
<?
echo 'Today is ' .date('l') . ' . The current Time is ' . date ('g:i a') .'.';<br>
?>

<?
if ((!$_POST[shipperorg]) || (!$_POST[origincity]) || (!$_POST[originstate])
|| (!$_POST[destcity]) || (!$_POST[deststate]) || (!$_POST[loadtype]) || (!$_POST[equiptype])) {
header( "Location: exit;
}
include("dbinfo.php");
$table_name = "loads";
// open connection
$connection = mysql_connect($host, $username, $password) or die ("Unable to connect!");

// select database
mysql_select_db($database) or die ("Unable to select database!");

// create query
$query = "INSERT INTO $table_name (shipperorg, pickupdate, origincity, originstate, destcity, deststate, loadtype, equiptype, weight, miles) VALUES ('$_POST[shipperorg]', '$_POST['$year:$month:$day']', '$_POST[origincity]', '$_POST[originstate]', '$_POST[destcity]', '$_POST[deststate]', '$_POST[loadtype]', '$_POST[equiptype]', '$_POST[weight]', '$_POST[miles]')";

// execute query
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());

// print message with ID of inserted record
echo "New record inserted with ID ".mysql_insert_id();

// close connection
mysql_close($connection);
?>

<head>

<title>Untitled Document</title>
</head>
<body>
<p>

<h1> Adding Information to <? echo "$table_name"; ?>
</h1>
</p>
<table width="316" border="0">
<tr>
<td width="161"><strong>Shipper Origin:</strong></td>
<td width="145"><? echo "$_POST[shipperorg]"; ?></td>
</tr>
<tr>
<td><strong>Pick Date: </strong></td>
<td><? echo "$_POST[$year:$month:$day]"; ?></td>
</tr>
<tr>
<td><strong>Origin City: </strong></td>
<td><? echo "$_POST[origincity]"; ?></td>
</tr>
<tr>
<td><strong>Origin State: </strong></td>
<td><? echo "$_POST[originstate]"; ?></td>
</tr>
<tr>
<td><strong>Destination City: </strong></td>
<td><? echo "$_POST[destcity]"; ?></td>
</tr>
<tr>
<td><strong>Destination State: </strong></td>
<td><? echo "$_POST[deststate]"; ?></td>
</tr>
<tr>
<td><strong>Load Type: </strong></td>
<td><? echo "$_POST[loadtype]"; ?></td>
</tr>
<tr>
<td><strong>Equipment Type: </strong></td>
<td><? echo "$_POST[equiptype]"; ?></td>
</tr>
<tr>
<td><strong>Weight</strong></td>
<td><? echo "$_POST[weight]"; ?></td>
</tr>
<tr>
<td><strong>Miles</strong></td>
<td><? echo "$_POST[miles]"; ?></td>
</tr>
</table>
<p><a href="newloads.html">Add Another Record</a></p>
<p><br>
</p>
</body>
</html>
 
you have a "<br>" in the middle of a php line. <br> is an html tag and is not valid php. you can echo html by putting the <br> inside the quotes.
 
by the way, please post you code within
Code:
tags as this improves readability and stops certain characters from being translated which could confuse people trying to help.
 
I just realized the domain is posted is there anyway for me remove it?

Thanks
 
you could try red-flagging your own post and/or contacting the domain administrators.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top