Problem with my contact.php page

booksbay

New Member
Messages
2
Reaction score
0
Points
0
Hi everyone!

I don't understand why my code doesn't work on x10 but I test it on localhost it runs perfectly. Can anyone show me where the problem is?

Here are the three file.

contactsformconfig.php:
PHP:
<?php
$FontWarning="#FF0000";
$FormWarning="#FFCC66";
$Destinataire="service-contact@booksbay.x10.mx";
$erreur="";
if(isset($_POST['submit'])){	
	while(list($var,$val)=each($_POST)){	if(!is_array($val)){		$$var=strip_tags($val);}	else{		while(list($arvar,$arval)=each($val)){				$$var[$arvar]=strip_tags($arval);}}}
	
	if(strlen($nom)<2){		$erreur.="<li>Le champ &laquo; Nom &raquo; est vide ou incomplet.";		$errf_1=1;}	if(strlen($prenom)<2){		$erreur.="<li>Le champ &laquo; Prénom &raquo; est vide ou incomplet.";		$errf_2=1;}	if(strlen($email)<2){		$erreur.="<li>Le champ &laquo; Email &raquo; est vide ou incomplet.";		$errf_3=1;}	else{		if(!mb_eregi('^[-!#$%&\'*+\./0-9=?A-Z^_`a-z{|}~]+'.		'@'.		'[-!#$%&\'*+\/0-9=?A-Z^_`a-z{|}~]+\.'.		'[-!#$%&\'*+\./0-9=?A-Z^_`a-z{|}~]+$',		$email)){			$erreur.="<li>La syntaxe de votre adresse e-mail n'est pas correcte.";			$errf_3=1;}}	if(strlen($message)<2){		$erreur.="<li>Le champ &laquo; Votre message &raquo; est vide ou incomplet.";		$errf_4=1;}	if($erreur==""){		// Création du message		$titre="Message de votre site";		$tete="From:Site@Http://booksbay.x10.mx\n";		$corps.="Nom : ".$nom."\n";		$corps.="Prénom : ".$prenom."\n";		$corps.="Email : ".$email."\n";		$corps.="Votre message : ".$message."\n";		mail($Destinataire, $titre, stripslashes($corps), $tete);				if(mail($Destinataire, $titre, stripslashes($corps), $tete)){			$ok_mail="true";			}	else{			$erreur.="<li>Une erreur est survenue lors de l'envoi du message, veuillez refaire une tentative.";}}}?>

contacts.php:
PHP:
<?php	session_start();?><!DOCTYPE html>
	<?php include("contactsformconfig.php"); ?>
<html><head>	<link rel="icon" type="image/ico" href="../images/favicon.ico" >   	<link rel="icon" type="image/gif" href="../images/animated_favicon1.gif" >        <meta charset="utf-8" />        <link rel="stylesheet" href="../style.css" />        <title>BooksBay I Contacts</title>                              </head>
<body id="background">
	<?php include("../nav.php"); ?>
	<div id="allpage">				<?php include("../header.php"); ?>
		<section class= "pageelement">
			<?php include("../aside.php"); ?>
			<article>						<h1> Nous contacter:</h1>						<?php if($ok_mail=="true"){ ?>									<?php include("contactsformok.php"); ?>
	<?php }else{ ?>

	<form action='<? echo $PHP_SELF ?>' method='post' name='Form'>
	
<?php if($erreur)
{ ?>ERREUR, votre message n'a pas été transmis<ul><?echo$erreur?></ul><?}?>					<p>Les champs marqué d'un * sont obligatoires<br />			<p><label>Nom* :</label><input type='text' style='<?if($errf_1==1){print("; background-color: ".$FormWarning."; color: ".$Fontwarning);}?>;' name='nom' value='<?echo stripslashes($nom);?>' size='24'></p>			<p><label>Prénom* :</label><input type='text' style='<?if($errf_2==1){print("; background-color: ".$FormWarning."; color: ".$Fontwarning);}?>;' name='prenom' value='<?echo stripslashes($prenom);?>' size='24'></p>			<p><label>Email* :</label><input type='text' style='<?if($errf_3==1){print("; background-color: ".$FormWarning."; color: ".$Fontwarning);}?>;' name='email' value='<?echo stripslashes($email);?>' size='24'></p>			<p><label>Votre message* :</label><textarea style='<?if($errf_4==1){print("; background-color: ".$FormWarning."; color: ".$Fontwarning);}?>;' name='message' rows='6' cols='40'><?echo$message?></textarea></p>			<p><input type='submit' name='submit' value='Envoyer'></p>			</form>
<?php } ?>						</article>		</section>	</div>			<?php include("../footer.php"); ?>	</body>

contactsformok.php
PHP:
<p>			Le message ci-dessous nous a bien été transmis, et nous vous en remercions.		<br />		<br />			<tt><?echo nl2br(stripslashes($corps));?></tt>			<br />			Nous allons y donner suite dans les meilleurs délais.					</p>
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
1. Define "doesn't work"
2. What have you tried to find the cause?
3. Format your code so that it is readable.
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
When it comes to formatting code, please pick and apply an indent style. Read my sig for more guidelines.
 

booksbay

New Member
Messages
2
Reaction score
0
Points
0
Hi everyone, i don't know what happened the last few days on x10 but now my page works normaly. Thx for the help, the next time I won't foget to format the code ^^
 
Top