le 15/02/2008 à 11:22
zOy
Bonjour, j'ai un petit problème, je voudrais envoyer un e-mail avec des informations entrées sur une autre page ...
L'erreur
ma page de traitement
la page d'envoi du mail
L'erreur
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sites-a-vendre/public_html/offer.php on line 11
Warning: Cannot modify header information - headers already sent by (output started at /home/sites-a-vendre/public_html/offer.php:11) in /home/sites-a-vendre/public_html/offer.php on line 41
ma page de traitement
<form method=post name=f2 onsubmit="return CheckContact();">
<table align=center width=400>
<caption align=center class=bh>
</caption>
<tr>
<td><strong>Votre offre </strong></td>
<td><input type=text name=oa class=InputField size=10 />
<font class=TableData> €</font></td>
</tr>
<tr>
<td><strong>Civilité</strong></td>
<td><select name="civilite" id="civilite">
<option selected="selected">Mr</option>
<option>Mme</option>
<option>Melle</option>
<option>Dr</option>
</select> </td>
</tr>
<tr>
<td><strong>Nom</strong></td>
<td><input type="text" name="nom" id="nom" /></td>
</tr>
<tr>
<td><strong>Prénom</strong></td>
<td><input type="text" name="prenom" id="prenom" /></td>
</tr>
<tr>
<td><strong>Votre e-mail</strong></td>
<td><input type="text" name="email" id="email" /></td>
</tr>
<tr>
<td>Votre societé</td>
<td><input type="text" name="societe" id="societe" /></td>
</tr>
<tr>
<td>Fonction</td>
<td><input type="text" name="fonction" id="fonction" /></td>
</tr>
<tr>
<td>Adresse</td>
<td><input type="text" name="adresse" id="adresse" />
<br /></td>
</tr>
<tr>
<td> </td>
<td><input type="text" name="adresse2" id="adresse2" /></td>
</tr>
<tr>
<td>Code postal</td>
<td><input type="text" name="textfield" id="textfield" /></td>
</tr>
<tr>
<td>Ville</td>
<td><input type="text" name="ville" id="ville" /></td>
</tr>
<tr>
<td>Pays</td>
<td><input type="text" name="pays" id="pays" /></td>
</tr>
<tr>
<td>Téléphone domicile</td>
<td><input type="text" name="tfix" id="tfix" /></td>
</tr>
<tr>
<td>Téléphone mobile</td>
<td><input type="text" name="tmobile" id="tmobile" /></td>
</tr>
<tr>
<td>Fax</td>
<td><input type="text" name="fax" id="fax" /></td>
</tr>
<tr>
<td valign="top"><strong>Votre message</strong></td>
<td class=TableData><textarea name=m1 rows=5 cols=30 class=InputField></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type=submit name=s1 value="Faire mon offre" class=SubmitButton /></td>
</tr>
</table>
</form>
la page d'envoi du mail
<?
if(isset($_POST[s1]))
{
$q1 = "select * from domain_domains, domain_members where domain_domains.domainid = '$_GET[DomainID]' and domain_domains.memberid = domain_members.memberid ";
$q1 = "update domain_domains set enchere = '$_POST[oa]'";
$r1 = mysql_query($q1) or die(mysql_error());
$a1 = mysql_fetch_array($r1);
$to = $a1[email];
$subject = "Nouvelle offre pour ".$a1[domainname];
$message = "Une nouvelle offre a été posté \n\n";
$message.= "Montant de l'offre: $_POST[oa]\n\n";
$message.= "$_POST[civilite] $_POST[nom] $_POST[prenom]\n\n";
$message.= "Adresse e-mail : $_POST[email]\n\n";
$message.= "Societé : $_POST[societe]\n\n";
$message.= "Fonction : $_POST[fonction]\n\n";
$message.= "Adresse : $_POST[adresse]\n\n";
$message.= "$_POST[adresse2]\n\n";
$message.= "$_POST[codepostal]\n\n";
$message.= "Ville : $_POST[ville]\n\n";
$message.= "Pays : $_POST[pays]\n\n";
$message.= "Tel. Fix : $_POST[tfix]\n\n";
$message.= "Tel. Port : $_POST[tmobile]\n\n";
$message.= "Fax : $_POST[fax]\n\n";
$message.= "Message : $_POST[m1]\n\n";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "From: $aset[ContactEmail]\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\n";
mail($to, $subject, $message, $headers);
header("location: offers_posted.php");
exit();
}
?>