...

View Full Version : Parse error: syntax error, unexpected ')' in



shkelzeni04
02-22-2012, 10:11 AM
Please Help me

Parse error: syntax error, unexpected ')' in /home/fmdecora/public_html/freecontactformprocess.php on line 44




<?php
/**
*
* URL: www.freecontactform.com
*
* Version: FreeContactForm Free V2
*
* Copyright (c) 2011 Stuart Cochrane
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
* Note: This is NOT the same code as the PRO version
*
*/

if(isset($_POST['Email_Address'])) {

include 'freecontactformsettings.php';

function died($error) {
echo "Sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}

if(!isset($_POST['Nom']) ||
!isset($_POST['Prénom']) ||
!isset($_POST['Adresse']) ||
!isset($_POST['Code postal']) ||
!isset($_POST['Ville']) ||
!isset($_POST['Téléphone']) ||
!isset($_POST['E-mail']) ||
!isset($_POST['Your_Message']) ||

)) {
died('Sorry, there appears to be a problem with your form submission.');
}

$Nom = $_POST['Nom']; // required
$Prénom = $_POST['Prénom']; // required
$Adresse = $_POST['Adresse']; // required
$Code postal = $_POST['Code postal']; // required
$Ville = $_POST['Ville']; // required
$telephone = $_POST['Téléphone']; // not required
$temail_form = $_POST['E-mail']; // not required
$Your_Message = $_POST['Your_Message']; // required


$error_message = "";

$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(preg_match($email_exp,$email_from)==0) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
if(strlen($Nom) < 2) {
$error_message .= 'Your Name does not appear to be valid.<br />';
}
if(strlen($Code postal) < 2) {
$error_message .= 'Your Code postal does not appear to be valid.<br />';
}

if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';

}

if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\r\n";

function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:");
return str_replace($bad,"",$string);
}

$email_message .= "Nom: ".clean_string($Nom)."\r\n";
$email_message .= "Prénom: ".clean_string($email_from)."\r\n";
$email_message .= "Adresse: ".clean_string($Adresse)."\r\n";
$email_message .= "Code postal: ".clean_string($Code postal)."\r\n";

$email_message .= "Ville: ".clean_string($Ville)."\r\n";
$email_message .= "Téléphone: ".clean_string($Téléphone)."\r\n";
$email_message .= "E-mail: ".clean_string($email_from)."\r\n";
$email_message .= "Message: ".clean_string($comments)."\r\n";


$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
header("Location: $thankyou");
?>
<script>location.replace('<?php echo $thankyou;?>')</script>
<?php
}
die();
?>

tangoforce
02-22-2012, 10:21 AM
It's this - you have one ) too many above your died line:



if(!isset($_POST['Nom']) ||
!isset($_POST['Prénom']) ||
!isset($_POST['Adresse']) ||
!isset($_POST['Code postal']) ||
!isset($_POST['Ville']) ||
!isset($_POST['Téléphone']) ||
!isset($_POST['E-mail']) ||
!isset($_POST['Your_Message']) ||

)) {
died('Sorry, there appears to be a problem with your form submission.');
}


Also, there is no php function called died, but there is die() so if thats your next error you know how to fix it now (just thought I'd mention that as you might / might not be using a custom function)

Nightfire
02-22-2012, 11:43 AM
You'll also need to delete the || after !isset($_POST['Your_Message']) ||

shkelzeni04
02-22-2012, 12:21 PM
now

I change to all died to die
Parse error: syntax error, unexpected T_EXIT, expecting T_STRING or '(' in /home/wwwkrmm/public_html/xeni/freecontactformprocess.php on line 27


Contact is here http://www.krm-higjiena.com/xeni/CONTACT.html

tangoforce
02-22-2012, 05:39 PM
Please post your new code.

shkelzeni04
02-22-2012, 11:28 PM
Help to me, I need a form contact, comments send to shkelzeni_04@yahoo.com






<style type="text/css">
<!--
.style4 {
color: #F8941A;
font-weight: bold;
font-size: 14px;
}
.style5 {color: #F8941A; font-size:18px}
#apDiv1 {
position:absolute;
left:8px;
top:-15px;
width:307px;
height:119px;
z-index:3;
}
#apDiv2 {
position:absolute;
left:46px;
top:-6px;
width:306px;
height:95px;
z-index:3;
}
#apDiv3 {
position:absolute;
left:42px;
top:69px;
width:383px;
height:26px;
z-index:4;
}
.style6 {color: #1392DF}
.style7 {color: #151718}
.style13 {font-size: 18px}
.style26 {color: #1C8ECD}
-->
</style>



<link rel="stylesheet" type="text/css" href="freecontactform.css">
<style type="text/css">
<!--
.style30 {color: #1F2224}
.style31 {
font-size: 16px;
font-weight: bold;
}
.style32 {
color: #FF0000;
font-size: 10px;
}
.style35 {color: #FFFFFF}
.style36 {font-size: 17px}
-->
</style>
<style type="text/css">
<!--
p.MsoNormal {
margin-top:0in;
margin-right:0in;
margin-bottom:10.0pt;
margin-left:0in;
line-height:115%;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
}
-->
</style>
<style type="text/css">
<!--
span.style311 {
font-weight:bold;
}
.style37 {font-size: 14px}
.style38 {padding-top:10px; padding-bottom:10px; text-align:center; font-weight: bold;}
.style44 {font-size: 13pt; }
.style45 {
font-size: 16px
}
.style46 {font-size: 12px}
.style48 {font-size: 10px; color: #F00; }
.style50 {font-size: 14px; font-weight: bold; }
.style52 {font-size: 14pt}
.style53 {color: #000000}
.style55 {font-size: 11pt}
-->
</style>









<table width="400px" class="freecontactform">
<tr>
<td colspan="2">

<div class="style38"></div>

<div class="freecontactformmessage style13">
<p class="style31 style45">Formulaire de contact</p>
<p>&nbsp;</p>
</div> </td>
</tr>
<tr>
<td valign="top">

<form action=" send_mail.php" method="post">

<label for="Nom" class="style37"><span class="style46">Nom</span><span class="style48"> * </span></label> </td>
<td valign="top">
<input name="Full_Name" type="text" class="style30" id="Full_Name" style="width:230px" maxlength="80"> </td>
</tr>
<tr>
<td valign="top">
<label for="Prenom" class="style37"><span class="style46">Prénom</span><span class="style48"> * </span></label> </td>
<td valign="top">
<input type="text" name="Prenom" id="Prenom" maxlength="100" style="width:230px"> </td>
</tr>
<tr>
<td valign="top">
<label for="Adresse" class="style37"><span class="style46">Adresse</span> <span class="style32">*</span></label> </td>
<td valign="top">
<input type="text" name="Adresse" id="Adresse" maxlength="100" style="width:230px"> </td>
</tr>

<tr>
<td valign="top">
<label for="Code postal" class="style37"><span class="style46">Code postal</span><span class="style48"> * </span></label> </td>
<td valign="top">
<input type="text" name="Code postal" id="Code postal" maxlength="80" style="width:230px"> </td>
<tr>
<td valign="top">
<label for="Ville" class="style37"><span class="style46">Ville</span><span class="style48"> * </span></label> </td>
<td valign="top">
<input type="text" name="Ville" id="Ville" maxlength="80" style="width:230px"> </td>
<tr>
<td valign="top">
<label for="Telephone" class="style37"><span class="style46">Téléphone</span><span class="style48"> * </span></label> </td>
<td valign="top">
<input type="text" name="Telephone" id="Telephone" maxlength="80" style="width:230px"> </td>
<tr>
<td valign="top">
<label for="Email_Address" class="style46">E-mail <span class="style48"> * </span></label> </td>
<td valign="top">
<input type="text" name="Email_Address" id="Email_Address" maxlength="80" style="width:230px"> </td>
<tr>
<td valign="top">
<label for="Your_Message" class="style46">Votre message<span class="style48"> * </span></label> </td>
<td valign="top"><textarea style="width:230px;height:160px" name="Your_Message" id="Your_Message" maxlength="2000"></textarea></td>
</tr>
<tr>
<td colspan="2" style="text-align:center" >&nbsp;</td>
</tr>
<tr>
<td colspan="2" style="text-align:center" ><p><br />
<span class="style30">.................. .......</span>
<input name="Submit" type="submit" class="style31" value="Envoyer">
<span class="style30">3 434</span>
<input name="Reset" type="reset" class="style31" value="Rétablir" />
<br />

tangoforce
02-23-2012, 10:13 AM
Help to me, I need a form contact, comments send to shkelzeni_04@yahoo.com


Firstly I will not send emails or PMs about how to solve a problem. Why? Because that then makes me soley responsible for it. On a public forum, anyone can contribute and if I miss something, someone else may see it (as has been demonstrated above).

Secondly if you want this fixed, you need to post your PHP code instead of your html and css. Posting the completely wrong and inappropriate code is only wasting everyones time.

myfayt
02-23-2012, 01:02 PM
Try this one.


<?php
/**
*
* URL: www.freecontactform.com
*
* Version: FreeContactForm Free V2
*
* Copyright (c) 2011 Stuart Cochrane
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*
* Note: This is NOT the same code as the PRO version
*
*/

if(isset($_POST['Email_Address'])) {

include 'freecontactformsettings.php';

function died($error) {
echo "Sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo "$error<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}

if(!isset($_POST['Nom']) ||
!isset($_POST['Prénom']) ||
!isset($_POST['Adresse']) ||
!isset($_POST['Code postal']) ||
!isset($_POST['Ville']) ||
!isset($_POST['Téléphone']) ||
!isset($_POST['E-mail']) ||
!isset($_POST['Your_Message']) ||

) {
die('Sorry, there appears to be a problem with your form submission.');
}

$Nom = $_POST['Nom']; // required
$Prénom = $_POST['Prénom']; // required
$Adresse = $_POST['Adresse']; // required
$Code postal = $_POST['Code postal']; // required
$Ville = $_POST['Ville']; // required
$telephone = $_POST['Téléphone']; // not required
$temail_form = $_POST['E-mail']; // not required
$Your_Message = $_POST['Your_Message']; // required


$error_message = "";

$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(preg_match($email_exp,$email_from)==0) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
if(strlen($Nom) < 2) {
$error_message .= 'Your Name does not appear to be valid.<br />';
}
if(strlen($Code postal) < 2) {
$error_message .= 'Your Code postal does not appear to be valid.<br />';
}

if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';

}

if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\r\n";

function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:");
return str_replace($bad,"",$string);
}

$email_message .= "Nom: ".clean_string($Nom)."\r\n";
$email_message .= "Prénom: ".clean_string($email_from)."\r\n";
$email_message .= "Adresse: ".clean_string($Adresse)."\r\n";
$email_message .= "Code postal: ".clean_string($Code postal)."\r\n";

$email_message .= "Ville: ".clean_string($Ville)."\r\n";
$email_message .= "Téléphone: ".clean_string($Téléphone)."\r\n";
$email_message .= "E-mail: ".clean_string($email_from)."\r\n";
$email_message .= "Message: ".clean_string($comments)."\r\n";


$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
header("Location: $thankyou");
?>
<script>location.replace('<?php echo $thankyou;?>')</script>
<?php
}
die();
?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum