if (isset($_POST['submit]))
(missing close apostrophe here...)
if (isset($_POST['submit']))
- not sure if this is THE problem, but A problem for sure.
-Brad
----- Original Message -----
From: [EMAIL PROTECTED]
Date: Tuesday, September 21, 2004 8:36 am
Subject: [PHP] unexpected $ error
> 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();
>
>
> ?>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php