Solved

php syntax error

Posted on 2009-05-05
4
330 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 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

821 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