unexpected $ error

From: Date: Tue, 21 Sep 2004 12:36:38 +0000
Subject: unexpected $ error
Groups: php.general 
Request: Send a blank email to php-general+get-197410@lists.php.net to get a copy of this message
hi, i get the following error when trying to run this code (see below): Parse error: parse error, unexpected $ in /full path form.php on line 59 i have checked for unclosed braces - none - and tried uploading the files in ascii format just in case but get the same same error. i have searched many forums but still haven't solved it. the include file just looks like this: <?php /* Title: xxxxxx Database Connection String Author: Luke Mackenzie Date: 18/09/04 */ @mysql_connect("xxxxxx","xxxxx","xxxxxxx") or die("Could not connect to MYSQL server"); ?> this is driving me nuts so if anyone can help, i'd be really grateful. thanks, lukemack. code follows...... <?php /* TITLE: Inmarsat Form handling script AUTHOR: Luke Mackenzie DATE: 18/09/04 */ // if the submit buttons has been pressed if (isset($_POST['submit])) { //connect to the server and select the database include "mysql.connect.php";// include the connection details @mysql_select_db("inmarsat_comp") or die ("Could not select Database"); // retrieve the posted information from the form $firstname = $_POST["first_name"]; $lastname = $_POST["last_name"]; $jobtitle = $_POST["job_title"]; $company = $_POST["company"]; $address1 = $_POST["address1"]; $address2 = $_POST["address2"]; $address3 = $_POST["address3"]; $city = $_POST["city"]; $county = $_POST["state"]; $postcode = $_POST["postcode"]; $telcode = $_POST["telephone_cc"]; $telnumber = $_POST["telephone_no"]; $faxcode = $_POST["fax_cc"]; $faxnumber = $_POST["fax_no"]; $email = $_POST["email_address"]; foreach($_POST["markets1"] AS $enterprise); $distribute = $_POST["OKToDistr"]; $market = $_POST["OKToMarket"]; //insert the form information into the database $query = "INSERT INTO inmarsat_comp SET firstname="$firstname", lastname="$lastname";"; $result =mysql_query($query); // run the query } //display an appropriate message if ($result) echo "<p>Form Data Successfully inserted!</p>"; else echo "<p> There was a problem inserting the form Data!</p>"; mysql_close(); ?>

« previous php.general (#197410) next »