Jim

I deleted a whole load of lines and still get the error. I've narrowed it
down to this code:

<?php
// Verify User Input:
  echo "<br><br><br>";

  $requiredFields =
array('Title','ChristianName','Surname','HomePhone','Address01','City','Post
code','Country','Gender','WorkPermitRequired','MyStatus');

  $errors = array();
  forEach($requiredFields as $fieldName)
  {
// If using post, change $_GET to $_POST instead
  if (empty($_POST[$fieldName]))
  {
// The field is empty
  $errors[] = 'Required field "' . $fieldName . '" empty!';
  }
  }
  if (count($errors))
  {
// Empty fields detected!
  echo "Sorry ";
  echo $_SESSION['UserCName'];
  echo "<br><br>";
  echo "The Following Fields Require Input ~ Please Go Back.";
  echo "<br><br>";

  forEach($errors as $error)
  {
  echo $error . '<br><br>';
  }
  }
  else
  {
   echo "Hi...!";
?>

But the error (line 40) is actually the last line...! :|

-- 
-----------------------------
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-----------------------------
"Jim Root" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I see one problem, but not the one you are talking about.
>
> > // Convert Values to Variables:
> >   $Title = $_POST[Title];
>
> This (and the rest of the post fields) should have quotes:
>
> $Title = $_POST["Title"];
>
> (php looks for a constant named Title, instead of the string "Title")
>
> What line gives you the parse error?
>
> On Mon, 19 Jul 2004 11:10:09 +0100, Harlequin
> <[EMAIL PROTECTED]> wrote:
> > I've checked my syntax but obviously missing something.
> >
> > Would anyone mind a quick scan:
> >
> > // Convert Values to Variables:
> >   $Title = $_POST[Title];
> >   $ChristianName = $_POST[ChristianName];
> >   $MiddleName = $_POST[MiddleName];
> >   $Surname = $_POST[Surname];
> >   $HomePhone = $_POST[HomePhone];
> >   $Address01 = $_POST[Address01];
> >   $Address02 = $_POST[Address02];
> >   $Address03 = $_POST[Address03];
> >   $City = $_POST[City];
> >   $Postcode = $_POST[Postcode];
> >   $Country = $_POST[Country];
> >   $Nationality = $_POST[Nationality];
> >   $Gender = $_POST[Gender];
> >   $WorkPermitRequired = $_POST[WorkPermitRequired];
> >   $MyStatus = $_POST[MyStatus];
> >
> > // Dump Data Into MembersData:
> >   $UserDataDump = "INSERT INTO MembersData (Title, ChristianName,
> > MiddleName, Surname, DOB, TelephoneHome, Address01, Address02,
Address03,
> > AddressCity, AddressPostcode, AddressCountry, Nationality, Gender,
> > WorkPermit, Status)
> >
> >
VALUES('$Title','$ChristianName','$MiddleName','$Surname','$HomePhone','$Add
> >
ress01','$Address02','$Address03','$City','$Postcode','$Country','$Nationali
> > ty','$Gender','$WorkPermitRequired','$MyStatus')";
> >    mysql_query($UserDataDump) or die("Couldn't Create User Data Entry.
MySQL
> > Error: " . mysql_error());
> >
> > --
> > -----------------------------
> >  Michael Mason
> >  Arras People
> >  www.arraspeople.co.uk
> > -----------------------------
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> -- 
> Jim Root
> [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to