script de petites annonces
Dernière réponse : dans Programmation
<html><head> <META NAME="DESCRIPTION" CONTENT="Le portail du développement PHP des jeunes Webmasters"> <META NAME="KEYWORDS" CONTENT="script, php, code, html, balises, programmation, javascript, web, webmaster, ressources, webmestre, jeune, débuter, commencer, langage"> <META NAME="REPLY-TO" CONTENT="eroan@free.fr"> <META NAME="AUTHOR" CONTENT="Eroan Boyer"> <META HTTP-EQUIV="imagetoolbar" CONTENT="no"> <META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="fr"> <META HTTP-EQUIV="VW96.OBJECT TYPE" CONTENT="Archive"> <META NAME="ROBOTS" CONTENT="index,follow"> <META NAME="REVISIT-AFTER" CONTENT="15 days"> <META NAME="ROBOTS" CONTENT="ALL"> <link rel="stylesheet" type="text/css" href="style-annonces.css"> <TITLE>Jeunes Webmasters :: Petites annonces ::</TITLE> </head><body> <p align="center">Voici le formulaire pour <b><i>passer une annonce</i></b> <hr width="500" size="1"></p><br> <div align="center"><center><table border="0" width="500" cellspacing="0" cellpadding="0"><tr><td width="100%"> <? if (isset($submit) AND ($ttr <> "Titre de votre annonce") AND ($modpats <> "Attention, Mot de passe!") AND ($obj <> "Décrivez ici ce que vous souhaitez vendre, avec un maximum d'informations : Etat, couleur, marque, prix...") AND ($inf <> "Donnez ici vos coordonnées : téléphone, email, adresse!") AND ($ttr <> "") AND ($modpats <> "") AND ($obj <> "") AND ($inf <> "")) { $fp = fopen("annonces.txt","a"); $ttr = trim($ttr); $ttr = strtoupper($ttr); $ttr = str_replace("\'", "'", $ttr); $ttr = str_replace('\"', '"', $ttr); $ttr = str_replace(" ,", ", ", $ttr); $ttr = str_replace(" , ", ", ", $ttr); $ttr = str_replace(" .", ". ", $ttr); $ttr = str_replace(" . ", ". ", $ttr); $ttr = str_replace("|", "I", $ttr); $ttr = str_replace("£", "L", $ttr); $obj = trim($obj); $obj = strtolower($obj); $obj = Ucwords($obj); $obj = str_replace("\'", "'", $obj); $obj = str_replace('\"', '"', $obj); $obj = str_replace(" ,", ", ", $obj); $obj = str_replace(" , ", ", ", $obj); $obj = str_replace(" .", ". ", $obj); $obj = str_replace(" . ", ". ", $obj); $obj = str_replace("|", "I", $obj); $obj = str_replace("£", "L", $obj); $obj = str_replace(CHR(10), "", $obj); $inf = trim($inf); $inf = strtolower($inf); $inf = Ucwords($inf); $inf = str_replace(CHR(10), " ", $inf); $inf = str_replace("\'", "'", $inf); $inf = str_replace('\"', '"', $inf); $inf = str_replace(" ,", ", ", $inf); $inf = str_replace(" , ", ", ", $inf); $inf = str_replace(" .", ". ", $inf); $inf = str_replace(" . ", ". ", $inf); $inf = str_replace("|", "I", $inf); $inf = str_replace("£", "L", $inf); $ttr = htmlentities($ttr); $modpats = htmlentities($modpats); $inf = htmlentities($inf); $obj = htmlentities($obj); $inf = str_replace("[mail]", "<a href=\"mailto:", $inf); $inf = str_replace("[/mail]", "\">[Contacter]</a>", $inf); $modpats = trim($modpats); $modpats = str_replace("\'", "'", $modpats); $modpats = str_replace('\"', '"', $modpats); $modpats = str_replace("|", "I", $modpats); $modpats = str_replace("£", "L", $modpats); fputs($fp, "$ttr|$obj|$inf|$modpats £"); fclose($fp); $ttr = strtolower($ttr); $ttr = Ucwords($ttr); echo("<p align=\"justify\">Votre annonce \"<b>$ttr</b>\" a bien été prise en compte! Vous pouvez vérifier en cliquant <a href=\"annonces.php\">sur ce lien</a>. Rappelez vous une fois votre annonce dépassée de contacter le webmaster pour lui demander de la retirer, en lui rappelant votre mot de passe (<b>$modpats</b>)!<br><br>Merci de votre confiance et à bientôt sur le site...</p>"); } else { if (isset($submit)) { echo("<script language=\"javascript\">alert('Vous devez renseigner tous les champs!');</script>"); } ?> <div align="center"><form name="form" method="POST" action="annonces-inscription.php"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr><td width="50%"><p align="right"><input maxlength="50" type="text" name="ttr" size="32" value="Titre de votre annonce"></p> </td><td width="50%"><p align="left"><input maxlength="50" type="text" name="modpats" size="32" value="Attention, Mot de passe!"> </td></tr><tr><td width="100%" colspan="2"> <p align="center"><textarea rows="8" name="obj" cols="66">Décrivez ici ce que vous souhaitez vendre, avec un maximum d'informations : Etat, couleur, marque, prix...</textarea></td> </tr><tr><td width="100%" colspan="2"><p align="center"><textarea rows="5" name="inf" cols="66">Donnez ici vos coordonnées : téléphone, email, adresse!</textarea></td> </tr><tr><td width="100%" colspan="2"> <p align="center"><INPUT TYPE="submit" value="Soumettre" name="submit"></td></tr></table></form></center> <? } ?> <br><br><center>Script développé par <a href="<a href="http://www.jeunes-webmasters.com" target="_blank">http://www.jeunes-webmasters.com</a>" target="_blank">Jeunes Webmasters</a> (Scripts PHP)<br>Powered by J-Web Annonces v1.0</center> </td></tr></table></center></div> </body> </html>
je ne c pas pour quoi les annonce ne sont pas enregistrer dans je fichier annonce.txt
mem si je l'ai mis en chmod777
aidez moi svp
Autres pages sur : script petites annonces
Lassé par la pub ? Créez un compte
Refet ton code en le disposant de la sorte :
Je peux t'assurer que ton code sera beaucoup plus propre et cela te permettera de réduire tes erreurs de code de 50% au moins.
De plus, quand je vois un code comme le tiens, je ne prend même pas la peine de l'étudier ou plutôt de le déchiffrer.
Edit ton post avec ton nouveau code.
<balise1> <balise2> <balise3> blablabla <balise3> <balise2> <balise1>
Je peux t'assurer que ton code sera beaucoup plus propre et cela te permettera de réduire tes erreurs de code de 50% au moins.
De plus, quand je vois un code comme le tiens, je ne prend même pas la peine de l'étudier ou plutôt de le déchiffrer.
Edit ton post avec ton nouveau code.
/* // J ai testé ça et c'est bon il ya une erreur dans le if je pense que que le bon if est : */
////////////////////////////
if (isset($_POST['submit']) )
AND ($_POST['ttr'] <> "Titre de votre annonce" ) AND ($_POST['modpats'] <> "Attention, Mot de passe!" ) AND ($_POST['obj'] <> "Décrivez ici ce que vous souhaitez vendre, avec un maximum d'informations : Etat, couleur, marque, prix..." ) AND ($_POST['inf'] <> "Donnez ici vos coordonnées : téléphone, email, adresse!" ) AND ($_POST['ttr'] <> "" ) AND ($_POST['modpats'] <> "" ) AND ($_POST['obj'] <> "" ) AND ($_POST['inf'] <> "" ))
///////////////////////// sinon ça c'est bon
<html><head>
<META NAME="DESCRIPTION" CONTENT="Le portail du développement PHP des jeunes Webmasters">
<META NAME="KEYWORDS" CONTENT="script, php, code, html, balises, programmation, javascript, web, webmaster, ressources, webmestre, jeune, débuter, commencer, langage">
<META NAME="REPLY-TO" CONTENT="eroan@free.fr">
<META NAME="AUTHOR" CONTENT="Eroan Boyer">
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="fr">
<META HTTP-EQUIV="VW96.OBJECT TYPE" CONTENT="Archive">
<META NAME="ROBOTS" CONTENT="index,follow">
<META NAME="REVISIT-AFTER" CONTENT="15 days">
<META NAME="ROBOTS" CONTENT="ALL">
<link rel="stylesheet" type="text/css" href="style-annonces.css">
<TITLE>Jeunes Webmasters :: Petites annonces ::</TITLE>
</head><body>
<p align="center">Voici le formulaire pour <b><i>passer une annonce</i></b>
<hr width="500" size="1"></p><br>
<div align="center"><center><table border="0" width="500" cellspacing="0" cellpadding="0"><tr><td width="100%">
<?php
if (isset($_POST['submit']) )
{
//if (isset($submit) AND ($_POST['ttr'] <> "Titre de votre annonce" ) AND ($_POST['modpats'] <> "Attention, Mot de passe!" ) AND ($_POST['obj'] <> "Décrivez ici ce que vous souhaitez vendre, avec un maximum d'informations : Etat, couleur, marque, prix..." ) AND ($_POST['inf'] <> "Donnez ici vos coordonnées : téléphone, email, adresse!" ) AND ($_POST['ttr'] <> "" ) AND ($_POST['modpats'] <> "" ) AND ($_POST['obj'] <> "" ) AND ($_POST['inf'] <> "" ))
//{
$fp = fopen("annonces.txt","a");
$ttr = $_POST['ttr'];
$ttr = trim($ttr);
$ttr = strtoupper($ttr);
$ttr = str_replace("\'", "'", $ttr);
$ttr = str_replace('\"', '"', $ttr);
$ttr = str_replace(" ,", ", ", $ttr);
$ttr = str_replace(" , ", ", ", $ttr);
$ttr = str_replace(" .", ". ", $ttr);
$ttr = str_replace(" . ", ". ", $ttr);
$ttr = str_replace("|", "I", $ttr);
$ttr = str_replace("£", "L", $ttr);
$obj = $_POST['obj'];
$obj = trim($obj);
$obj = strtolower($obj);
$obj = Ucwords($obj);
$obj = str_replace("\'", "'", $obj);
$obj = str_replace('\"', '"', $obj);
$obj = str_replace(" ,", ", ", $obj);
$obj = str_replace(" , ", ", ", $obj);
$obj = str_replace(" .", ". ", $obj);
$obj = str_replace(" . ", ". ", $obj);
$obj = str_replace("|", "I", $obj);
$obj = str_replace("£", "L", $obj);
$obj = str_replace(CHR(10), "", $obj);
$inf = $_POST['inf'];
$inf = trim($inf);
$inf = strtolower($inf);
$inf = Ucwords($inf);
$inf = str_replace(CHR(10), " ", $inf);
$inf = str_replace("\'", "'", $inf);
$inf = str_replace('\"', '"', $inf);
$inf = str_replace(" ,", ", ", $inf);
$inf = str_replace(" , ", ", ", $inf);
$inf = str_replace(" .", ". ", $inf);
$inf = str_replace(" . ", ". ", $inf);
$inf = str_replace("|", "I", $inf);
$inf = str_replace("£", "L", $inf);
$ttr = htmlentities($ttr);
$modpats = $_POST['modpats'];
$modpats = htmlentities($modpats);
$inf = htmlentities($inf);
$obj = htmlentities($obj);
$inf = str_replace("[mail]", "<a href=\"mailto:", $inf);
$inf = str_replace("[/mail]", "\">[Contacter]</a>", $inf);
$modpats = trim($modpats);
$modpats = str_replace("\'", "'", $modpats);
$modpats = str_replace('\"', '"', $modpats);
$modpats = str_replace("|", "I", $modpats);
$modpats = str_replace("£", "L", $modpats);
fputs($fp, "$ttr|$obj|$inf|$modpats £" );
fclose($fp);
$ttr = strtolower($ttr);
$ttr = Ucwords($ttr);
echo("<p align=\"justify\">Votre annonce \"<b>$ttr</b>\" a bien été prise en compte! Vous pouvez vérifier en cliquant <a href=\"annonces.php\">sur ce lien</a>. Rappelez vous une fois votre annonce dépassée de contacter le webmaster pour lui demander de la retirer, en lui rappelant votre mot de passe (<b>$modpats</b> )!<br><br>Merci de votre confiance et à bientôt sur le site...</p>" );
}
else
{
if (isset($submit))
{
echo("<script language=\"javascript\">alert('Vous devez renseigner tous les champs!');</script>" );
}
?>
<div align="center"><form name="form" method="POST" action="index1.php"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr><td width="50%"><p align="right"><input maxlength="50" type="text" name="ttr" size="32" value="Titre de votre annonce"></p>
</td><td width="50%"><p align="left"><input maxlength="50" type="text" name="modpats" size="32" value="Attention, Mot de passe!">
</td></tr><tr><td width="100%" colspan="2">
<p align="center"><textarea rows="8" name="obj" cols="66">Décrivez ici ce que vous souhaitez vendre, avec un maximum d'informations : Etat, couleur, marque, prix...</textarea></td>
</tr><tr><td width="100%" colspan="2"><p align="center"><textarea rows="5" name="inf" cols="66">Donnez ici vos coordonnées : téléphone, email, adresse!</textarea></td>
</tr><tr><td width="100%" colspan="2">
<p align="center"><INPUT TYPE="submit" value="Soumettre" name="submit"></td></tr></table></form></center>
<?php
}
?>
<br><br><center>Script développé par <a href="http://www.jeunes-webmasters.com" target="_blank">Jeunes Webmasters</a> (Scripts PHP)<br>Powered by J-Web Annonces v1.0</center>
</td></tr></table></center></div>
</body>
</html>
////////////////////////////
if (isset($_POST['submit']) )
AND ($_POST['ttr'] <> "Titre de votre annonce" ) AND ($_POST['modpats'] <> "Attention, Mot de passe!" ) AND ($_POST['obj'] <> "Décrivez ici ce que vous souhaitez vendre, avec un maximum d'informations : Etat, couleur, marque, prix..." ) AND ($_POST['inf'] <> "Donnez ici vos coordonnées : téléphone, email, adresse!" ) AND ($_POST['ttr'] <> "" ) AND ($_POST['modpats'] <> "" ) AND ($_POST['obj'] <> "" ) AND ($_POST['inf'] <> "" ))
///////////////////////// sinon ça c'est bon
<html><head>
<META NAME="DESCRIPTION" CONTENT="Le portail du développement PHP des jeunes Webmasters">
<META NAME="KEYWORDS" CONTENT="script, php, code, html, balises, programmation, javascript, web, webmaster, ressources, webmestre, jeune, débuter, commencer, langage">
<META NAME="REPLY-TO" CONTENT="eroan@free.fr">
<META NAME="AUTHOR" CONTENT="Eroan Boyer">
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="fr">
<META HTTP-EQUIV="VW96.OBJECT TYPE" CONTENT="Archive">
<META NAME="ROBOTS" CONTENT="index,follow">
<META NAME="REVISIT-AFTER" CONTENT="15 days">
<META NAME="ROBOTS" CONTENT="ALL">
<link rel="stylesheet" type="text/css" href="style-annonces.css">
<TITLE>Jeunes Webmasters :: Petites annonces ::</TITLE>
</head><body>
<p align="center">Voici le formulaire pour <b><i>passer une annonce</i></b>
<hr width="500" size="1"></p><br>
<div align="center"><center><table border="0" width="500" cellspacing="0" cellpadding="0"><tr><td width="100%">
<?php
if (isset($_POST['submit']) )
{
//if (isset($submit) AND ($_POST['ttr'] <> "Titre de votre annonce" ) AND ($_POST['modpats'] <> "Attention, Mot de passe!" ) AND ($_POST['obj'] <> "Décrivez ici ce que vous souhaitez vendre, avec un maximum d'informations : Etat, couleur, marque, prix..." ) AND ($_POST['inf'] <> "Donnez ici vos coordonnées : téléphone, email, adresse!" ) AND ($_POST['ttr'] <> "" ) AND ($_POST['modpats'] <> "" ) AND ($_POST['obj'] <> "" ) AND ($_POST['inf'] <> "" ))
//{
$fp = fopen("annonces.txt","a");
$ttr = $_POST['ttr'];
$ttr = trim($ttr);
$ttr = strtoupper($ttr);
$ttr = str_replace("\'", "'", $ttr);
$ttr = str_replace('\"', '"', $ttr);
$ttr = str_replace(" ,", ", ", $ttr);
$ttr = str_replace(" , ", ", ", $ttr);
$ttr = str_replace(" .", ". ", $ttr);
$ttr = str_replace(" . ", ". ", $ttr);
$ttr = str_replace("|", "I", $ttr);
$ttr = str_replace("£", "L", $ttr);
$obj = $_POST['obj'];
$obj = trim($obj);
$obj = strtolower($obj);
$obj = Ucwords($obj);
$obj = str_replace("\'", "'", $obj);
$obj = str_replace('\"', '"', $obj);
$obj = str_replace(" ,", ", ", $obj);
$obj = str_replace(" , ", ", ", $obj);
$obj = str_replace(" .", ". ", $obj);
$obj = str_replace(" . ", ". ", $obj);
$obj = str_replace("|", "I", $obj);
$obj = str_replace("£", "L", $obj);
$obj = str_replace(CHR(10), "", $obj);
$inf = $_POST['inf'];
$inf = trim($inf);
$inf = strtolower($inf);
$inf = Ucwords($inf);
$inf = str_replace(CHR(10), " ", $inf);
$inf = str_replace("\'", "'", $inf);
$inf = str_replace('\"', '"', $inf);
$inf = str_replace(" ,", ", ", $inf);
$inf = str_replace(" , ", ", ", $inf);
$inf = str_replace(" .", ". ", $inf);
$inf = str_replace(" . ", ". ", $inf);
$inf = str_replace("|", "I", $inf);
$inf = str_replace("£", "L", $inf);
$ttr = htmlentities($ttr);
$modpats = $_POST['modpats'];
$modpats = htmlentities($modpats);
$inf = htmlentities($inf);
$obj = htmlentities($obj);
$inf = str_replace("[mail]", "<a href=\"mailto:", $inf);
$inf = str_replace("[/mail]", "\">[Contacter]</a>", $inf);
$modpats = trim($modpats);
$modpats = str_replace("\'", "'", $modpats);
$modpats = str_replace('\"', '"', $modpats);
$modpats = str_replace("|", "I", $modpats);
$modpats = str_replace("£", "L", $modpats);
fputs($fp, "$ttr|$obj|$inf|$modpats £" );
fclose($fp);
$ttr = strtolower($ttr);
$ttr = Ucwords($ttr);
echo("<p align=\"justify\">Votre annonce \"<b>$ttr</b>\" a bien été prise en compte! Vous pouvez vérifier en cliquant <a href=\"annonces.php\">sur ce lien</a>. Rappelez vous une fois votre annonce dépassée de contacter le webmaster pour lui demander de la retirer, en lui rappelant votre mot de passe (<b>$modpats</b> )!<br><br>Merci de votre confiance et à bientôt sur le site...</p>" );
}
else
{
if (isset($submit))
{
echo("<script language=\"javascript\">alert('Vous devez renseigner tous les champs!');</script>" );
}
?>
<div align="center"><form name="form" method="POST" action="index1.php"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr><td width="50%"><p align="right"><input maxlength="50" type="text" name="ttr" size="32" value="Titre de votre annonce"></p>
</td><td width="50%"><p align="left"><input maxlength="50" type="text" name="modpats" size="32" value="Attention, Mot de passe!">
</td></tr><tr><td width="100%" colspan="2">
<p align="center"><textarea rows="8" name="obj" cols="66">Décrivez ici ce que vous souhaitez vendre, avec un maximum d'informations : Etat, couleur, marque, prix...</textarea></td>
</tr><tr><td width="100%" colspan="2"><p align="center"><textarea rows="5" name="inf" cols="66">Donnez ici vos coordonnées : téléphone, email, adresse!</textarea></td>
</tr><tr><td width="100%" colspan="2">
<p align="center"><INPUT TYPE="submit" value="Soumettre" name="submit"></td></tr></table></form></center>
<?php
}
?>
<br><br><center>Script développé par <a href="http://www.jeunes-webmasters.com" target="_blank">Jeunes Webmasters</a> (Scripts PHP)<br>Powered by J-Web Annonces v1.0</center>
</td></tr></table></center></div>
</body>
</html>
Lassé par la pub ? Créez un compte
- Contenus similaires :
- ForumScript pour déposer des annonces sur mon site
- ForumScript petites annonces
- ForumPetites questions sur les scripts/hebergeurs
- ForumComment creer un site de petites annonce ?
- ForumQUI PEUT M'AIDER A TRADUIRE MA PETITE ANNONCE
- Forum[Script]Petite boite qui suit la souris
- ForumPetite question rapide, mettre une balise <script> dans un background
- ForumPetites annonces (résolu)
- ForumPetites annonces
- Voir plus