View Single Post
  #5 (permalink)  
Old 18-04-2008, 11:40
Pangloss Pangloss is offline
new member
 
Join Date: Apr 2008
Posts: 6
Default

Having serious difficulties getting this thing to work!! One of the troubles may be that I wrote the original form using Dreamweaver 8 whose (automatic) code looks a bit different to yours - this is why I did not recognise it as PHP (many apologies)! The whole form has worked very reliably so far if it was not for these duplicate entries.

This page starts with :

<?php require_once('Connections/databasename_conn.php'); ?>

So I put in your db_connect function directly below this line.

This is what your code came out like when I put in the names:

<?php
$link_id = db_connect();
$sql=SELECT * from members3 where emailaddress="'.$_POST[emailaddress].'";
$Result=mysql_query($sql, $link_id);
if (mysql_num_rows($Result)>0) {
//display the html page with the error message
header("Location:thankyou.htm")
} else {
//unique email address
//so insert into the database
$sql='Insert into members3 set emailaddress="'.$_POST[emailaddress]'"; //add whatever fields you need to enter
$Result=mysql_query($sql, $link_id);
header(Location:"thankyou2.htm")
}
?>

The line in bold has consistently produced the error message:
Parse error: syntax error, unexpected T_STRING in C:\wamp\www\vu3aEUK2\application_form2.php on line 567 when run on local server whatever I do to try to correct it

On the remote server it objects to the previous line 566

I am quite at a loss!!
Reply With Quote