Solved

php syntax error

Posted on 2009-05-05
4
331 Views
Last Modified: 2012-05-06
hi. i am stumped as to why this script is giving a syntax error? the error is

Parse error: syntax error, unexpected '{' on line 183

The code below is the area around 183. it looks ok 2 me but obviously it is not. anyone see where i went wrong? cheers

<?php
	if (isset($_POST['prez']) && (isset($_POST['Intext'])) {
		include 'transsent.php';
		$to = "xxx@whatever.com";
		$subject = "Form Enquiry";
		$message = "You have an enquiry from $name for a whatever.\n\nEmail: $email";
		$headers = "From: $email";
		mail($to, $subject, $message, $headers);
		} 
?>

Open in new window

0
Comment
Question by:peter_coop
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 24305382
you have 1 ( too much:

      if (isset($_POST['prez']) && (isset($_POST['Intext'])) {
must be
      if (isset($_POST['prez']) && isset($_POST['Intext'])) {
0
 
LVL 28

Expert Comment

by:gamebits
ID: 24305388
try

if (isset($_POST['prez']) && (isset($_POST['Intext']))) {
0
 

Expert Comment

by:sc_84
ID: 24305419
You have one bracket open && (isset($_POST['lntext']

You either need to close this bracket or remove it:

if (isset($_POST['prez']) && isset($_POST['Intext'])) {
            include 'transsent.php';
            $to = "xxx@whatever.com";
            $subject = "Form Enquiry";
            $message = "You have an enquiry from $name for a whatever.\n\nEmail: $email";
            $headers = "From: $email";
            mail($to, $subject, $message, $headers);
            }
0
 

Author Closing Comment

by:peter_coop
ID: 31578045
thx once again
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question