I resolved this by re-creating the script... it runs smoothly now...
Thanks for all your help (as allways) it was promt and useful.....
THANK YOU EVERYONE!!!
I have created a form handling code that seems be OK even after checking it several times but it keeps coming up with this error:
(>> is the path to the file)
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in >>/index.php on line 31
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in >>/index.php on line 31
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in >>/index.php on line 31
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in >>/index.php on line 31
Parse error: syntax error, unexpected $end in >>/index.php on line 245
This is my script... cna anyone see what's wrong?
<?php if(isset($_POST['submit'])){
$script = '<script type="text/javascript">' . \n . 'function message(){' . \n . 'alert(' . $message . ')' . \n . '}' . \n . '\</script\>';
echo $script;
?>
</head>
<body>
<!--PHP FORM HANDLING-->
<?php if(isset($_POST['submit'])){$name = $_POST['name'];
$user = $_POST['user'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$to = 'isaac.seymour@gmail.com';
$subject = 'ThePeccavi Comment';
trim($comments, '/n .. /r');
if(!isset($name)){
$message = 'Please enter a name/nickname.';
}
elseif(!isset($comments)){
$message = 'Please enter comments.';
}
else{
if(!isset($email)){
$email = $name . '@anonymous.co.uk';
}
$body = 'Name:' . $name . 'Comments:' . $comments;
$sent = mail($to, $subject, $body, 'From: $email','');
}
if($sent == 1){
$message = 'Message sent.';
}
?>
Thanks
TP
PS. This is the only php code on the page... it is just above and below the "body" tag.