Bonjour,
j'ai un petit souci avec des cookie je comprends pas trop d'ou sa vient
si quelqu'un pouvais m'aider svp sa serais sympa merci
je vous mets mon code page et l'erreur
<!-- Script pour le controle des champs obigatoire !-->
<?php
$controle=1;
if (isset($_POST['envoyer']) && empty($_POST['civ']))
{ echo "<script language='javascript'> alert('Il faut selectionner votre civilté') </script>";
$controle=0;
}
if (isset($_POST['nom']) && empty($_POST['nom']))
{echo "<script language='javascript'> alert('Il faut donner votre nom') </script>";
$controle=0;
}
if (isset($_POST['prenom']) && empty($_POST['prenom']))
{echo "<script language='javascript'> alert('Il faut donner votre prenom') </script>";
$controle=0;
}
if (isset($_POST['adresse']) && empty($_POST['adresse']))
{echo "<script language='javascript'> alert('Il faut donner votre adresse') </script>";
$controle=0;
}
if (isset($_POST['codepostal']) && empty($_POST['codepostal']))
{echo "<script language='javascript'> alert('Il faut donner votre code postal') </script>";
$controle=0;
}
if (isset($_POST['ville']) && empty($_POST['ville']))
{echo "<script language='javascript'> alert('Il faut donner votre ville') </script>";
$controle=0;
}
if (isset($_POST['pays']) && empty($_POST['pays']))
{echo "<script language='javascript'> alert('Il faut donner votre pays') </script>";
$controle=0;
}
if (isset($_POST['email']) && empty($_POST['email']))
{echo "<script language='javascript'> alert('Il faut donner votre e-mail') </script>";
$controle=0;
}
if (isset($_POST['pseudo']) && empty($_POST['pseudo']))
{echo "<script language='javascript'> alert('Il faut donner un pseudo') </script>";
$controle=0;
}
?><!-- Fin du Script pour le controle des champs obigatoire !-->
<form name="inscription" action="inscription.php" method="post">
<table><tr>
<td align="right">Civilité<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td>
<input type="radio" name="civ" value="M" >M
<input type="radio" name="civ" value="Mme" >Mme
<input type="radio" name="civ" value="Mlle" >Mlle
</td>
</tr>
<tr>
<td align="right">Société </td>
<td width="10"> </td>
<td><input type="text" name="societe" size="30" maxlength="30"></td>
</tr>
<tr>
<td align="right">Nom<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td><input type="text" name="nom" value="<?php if(isset($_POST['nom'])) echo $_POST['nom']; ?>" size="30" maxlength="30"></td>
</tr>
<tr>
<td align="right">Prénom<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td><input type="text" name="prenom" value="<?php if(isset($_POST['prenom'])) echo $_POST['prenom']; ?>" size="30" maxlength="30"></td>
</tr>
<tr>
<td align="right">Adresse<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td><input type="text" name="adresse" value="<?php if(isset($_POST['adresse'])) echo $_POST['adresse']; ?>" size="30" maxlength="80"></td>
</tr>
<tr>
<td align="right">Code Postal<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td><input type="text" name="codepostal" value="<?php if(isset($_POST['codepostal'])) echo $_POST['codepostal']; ?>" size="30" maxlength="5"></td>
</tr>
<tr>
<td align="right">Ville<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td><input type="text" name="ville" value="<?php if(isset($_POST['ville'])) echo $_POST['ville']; ?>" size="30" maxlength="60"></td>
</tr>
<tr>
<td align="right">Pays<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td><input type="text" name="pays" value="<?php if(isset($_POST['pays'])) echo $_POST['pays']; ?>" size="30" maxlength="60"></td>
</tr>
<tr>
<td align="right">Email<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td><input type="text" name="email" value="<?php if(isset($_POST['email'])){echo $_POST['email'];} ?>" size="30" maxlength="80"></td>
</tr>
<tr>
<td align="right">Nom d'utilisateur<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td><input type="text" name="pseudo" value="<?php if(isset($_POST['pseudo'])){echo $_POST['pseudo'];} ?>" /></td>
</tr>
<tr>
<td align="right">Mot de passe<font color="#FF0000">*</font></td>
<td width="10"> </td>
<td><input type="password" name="pass" size="30" maxlength="15"></td>
</tr>
<tr>
<td align="right" colspan="3"><input type="submit" value="RESERVER" name="envoyer"></td>
</tr>
</table>
</form>
<?php
if(isset($_POST['envoyer'])&& $controle ==1 )
{$requete1 = "insert into clients(num_client,civilite,nom,prenom,adresse,codepostal,ville,pays,email,pseudo)
values('','$_POST[civ]','$_POST[nom]','$_POST[prenom]','$_POST[adresse]','$_POST[codepostal]','$_POST[ville]','$_POST[pays]','$_POST[email]','$_POST[pseudo]')";
$dbprotect = mysql_pconnect("localhost ","xxxxxxx", "xxxxx") or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db('xxxxxxxxx', $dbprotect);
$result = mysql_query($requete1,$dbprotect) or die(mysql_error());
echo "<script language='javascript'> alert('votre demande a été enregistré avec succée.Merci de votre confiance ') </script> ";
}
?>
<?
$a=$_cookie["nom"];
$b=$_cookie["prenom"];
$b=$_cookie["adresse"];
$b=$_cookie["codepostal"];
$b=$_cookie["ville"];
$b=$_cookie["pays"];
$c=$_cookie["mail"];
$b=$_cookie["pseudo"];
setcookies("nom","$a",mktime()+100000);
setcookies("prenom","$b",mktime()+100000);
setcookies("adresse","$a",mktime()+100000);
setcookies("codepostal","$a",mktime()+100000);
setcookies("ville","$a",mktime()+100000);
setcookies("pays","$a",mktime()+100000);
setcookies("email","$c",mktime()+100000);
setcookies("pseudo","$a",mktime()+100000);
echo" cher(e) $a $b votre mail est $c vous etes deja inscrit";
?>
l'erreur :
Fatal error: Call to undefined function setcookies() in
/var/www/vhosts/xxxxxxxxxx/httpdocs/inscription.php on line 155
Je remercie les personne qui voudront bien m'aider
Afficher la suite