Hello everyone, I am getting a parse error on a piece of code I wrote and after looking at it for so long I can't figure it out. The error is in line 23 which is the "<INPUT TYPE>" line. As you can see, I am trying to pass the variable $sitename to the page indicated under the redirect...am I doing that right? any help is greatly appreciated.
<?
if ((!$sitename) || (!$address1)) {
header ("Location: addsite.php");
exit;
} else {
//connect to the database and store all the information
$db_name = "system_outage";
$table_name = "site";
$connection = mysql_connect("localhost", "root", "netops") or die ("could not connect do database");
$db = mysql_select_db($db_name, $connection) or die ("cannot select database");
$sql = "INSERT INTO $table_name (sitename,address1,address2, city, state, postal_code, setup, site_status, contacts, description, notes)
VALUES (\"$sitename\",\"$address1\", \"$address2\", \"$city\", \"$state\", \"$postal_code\", \"$setup\", \"$site_status\", \"$contacts\", \"$description\", \"$notes\")";
$result = mysql_query($sql) or die ("could not execute query");
header ("Location: addcircuit.php");
exit;
<INPUT TYPE="hidden" name="sitename" value="$sitename">
}
?>