Solved

php syntax error

Posted on 2009-05-05
4
325 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
4 Comments
 
LVL 142

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now