homepage Welcome to WebmasterWorld Guest from 50.16.112.199
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Form Submission Error
Error During Form Submission
sagun



 
Msg#: 4504375 posted 8:39 am on Oct 5, 2012 (gmt 0)

hi, I have just started learning php And i am facing problem in the form i have made.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in public_html/feedback/contact_form/contact.php on line 54


<?php

include 'config.php';
error_reporting (E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;

if($post)
{
include 'functions.php';
$name = stripslashes($_POST['name']);
$email = trim($_POST['email']);
$address = stripslashes($_POST['address']);
$contact = stripslashes($_POST['contact']);
$design = stripslashes($_POST['design']);
$colour = stripslashes($_POST['colour']);

$error = '';

// Check name
if(!$name)
{
$error .= 'I think you forget to enter your name.<br />';
}
// Check email
if(!$email)
{
$error .= 'I think you forget to enter your e-mail id.<br />';
}
// Check feedback msg
if(!$address)
{
$error .= 'I think you forget to enter your address.<br />';
}
if(!$contact)
{
$error .= 'I think you forget to enter your Contact number.<br />';
}
if(!$design)
{
$error .= 'I think you forget to select the Design.<br />';
}
if(!$colour)
{
$error .= 'I think you forget to select the colour.<br />';
}

if($email && !ValidateEmail($email))
{
$error .= 'Invalid E-mail id !<br />';
}
if(!$error)
{
$mail = mail(WEBMASTER_EMAIL, $subject, $address, $contact, $design, $colour,
"From: ".$name." <".$email.">\r\n"
."Reply-To: ".$email."\r\n"
."X-Mailer: PHP/" . phpversion());
if($mail)
{
echo 'OK';
}
}
else
{
echo '<div class="notification_error">'.$error.'</div>';
}
}
?>

 

omoutop

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 4504375 posted 1:33 pm on Oct 5, 2012 (gmt 0)

Your mail() function is wrong. Wrong number of parameters.
Take a look at php mail() [gr2.php.net] to see proper syntax

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved