begin process at 2012 05 27 20:54:59
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Formulaires

 > VOTE

VOTE


 Information sur la source

Note :
6,33 / 10 - par 3 personnes
6,33 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Formulaires Niveau :Débutant Date de création :11/06/2003 Date de mise à jour :11/06/2003 17:53:15 Vu :5 245

Auteur : ekinoks

Ecrire un message privé
Site perso
Commentaire sur cette source (6)
Ajouter un commentaire et/ou une note

 Description

bon c mon 1ere code php alors... soyllé cool meme si c pas bien codé ^^ c qu'une 1ere ;).
c'est un sondage, il y a des truk bien dans mon code ou il y a tout a jéter ?

Source

  • SONDAGE.PHP
  • ¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Ca c'est just le FORM, pas de code php la dedans... je savez pâs si il fallé le métre donc dans le doute je l'est mi ^^
  • -----------------------------------------------------------------------------------------
  • <html>
  • <body>
  • <p>&nbsp;</p>
  • <p>&nbsp;</p>
  • <form action="sondagee.php">
  • <table border="1" width="22%" height="100">
  • <tr>
  • <td width="45%" height="19">
  • <p align="center">POUR</td>
  • <td width="29%" height="19">
  • <p align="center">CONTRE</td>
  • <td width="42%" height="19"></td>
  • </tr>
  • <tr>
  • <td width="45%" height="19">
  • <p align="center"><input type="radio" value="p1" name="sondage" checked></td>
  • <td width="29%" height="19">
  • <p align="center"><input type="radio" name="sondage" value="p4"></td>
  • <td width="42%" height="19">Vote 1</td>
  • </tr>
  • <tr>
  • <td width="45%" height="19">
  • <p align="center"><input type="radio" name="sondage" value="p2"></td>
  • <td width="29%" height="19">
  • <p align="center"><input type="radio" name="sondage" value="p5"></td>
  • <td width="42%" height="19">Vote 2</td>
  • </tr>
  • <tr>
  • <td width="45%" height="19">
  • <p align="center"><input type="radio" name="sondage" value="p3"></td>
  • <td width="29%" height="19">
  • <p align="center"><input type="radio" name="sondage" value="p6"></td>
  • <td width="42%" height="19">Vote 3</td>
  • </tr>
  • <tr>
  • <td width="24%" colspan="2" height="1">
  • <p align="center"><input type="submit" value="Valider"></td>
  • <td width="42%" height="1"></td>
  • </tr>
  • </table>
  • </form>
  • </body>
  • </html>
  • -----------------------------------------------------------------------------------------Sondagee.php
  • ¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Voila c la ou est tout le code php
  • -----------------------------------------------------------------------------------------
  • <?
  • include('connect.inc');
  • $connect=mysql_connect($hote,$user,$pass);
  • $base = mysql_select_db("sondage");
  • $mareq="select * from ".$sondage."";
  • $resultat=mysql_query($mareq);
  • $nbre=mysql_numrows($resultat);
  • $nb = $nbre + 1;
  • mysql_query("insert into $sondage(nb) values ('$nb')");
  • for ($i = 1; $i <=6; $i++)
  • {
  • $pi = "p$i";
  • $mareq ="select * from p$i";
  • $resultat=mysql_query($mareq);
  • $$pi = mysql_numrows($resultat);
  • }
  • ?>
  • <html>
  • <body>
  • <p>&nbsp;</p>
  • <p>&nbsp;</p>
  • <form action="sondage.php">
  • <table border="1" width="22%">
  • <tr>
  • <td width="37%">POUR</td>
  • <td width="25%">CONTRE</td>
  • <td width="27%">&nbsp;</td>
  • </tr>
  • <tr>
  • <td width="37%"><? echo $p1; ?>
  • </td>
  • <td width="25%"><? echo $p4; ?></td>
  • <td width="27%">Vote 1</td>
  • </tr>
  • <tr>
  • <td width="37%"><? echo $p2; ?></td>
  • <td width="25%"><? echo $p5; ?></td>
  • <td width="27%">Vote 2</td>
  • </tr>
  • <tr>
  • <td width="37%"><? echo $p3; ?></td>
  • <td width="25%"><? echo $p6; ?></td>
  • <td width="27%">Vote 3</td>
  • </tr>
  • <tr>
  • <td width="39%" colspan="2">
  • <form method="POST" action="--WEBBOT-SELF--">
  • <p><a href="sondage.php"><input type="button" value="Changer de vote" name="B3"></a></p>
  • </form>
  • <td width="27%">&nbsp;</td>
  • </tr>
  • </table>
  • </form>
  • <p><a href="sondage.php">test</a></p>
  • </body>
  • </html>
SONDAGE.PHP
¯¯¯¯¯¯¯¯¯¯¯¯¯
Ca c'est just le FORM, pas de code php la dedans... je savez pâs si il fallé le métre donc dans le doute je l'est mi ^^
-----------------------------------------------------------------------------------------
<html>
<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<form action="sondagee.php">
  <table border="1" width="22%" height="100">
    <tr>
      <td width="45%" height="19">
        <p align="center">POUR</td>
      <td width="29%" height="19">
        <p align="center">CONTRE</td>
      <td width="42%" height="19"></td>
    </tr>
    <tr>
      <td width="45%" height="19">
        <p align="center"><input type="radio" value="p1" name="sondage" checked></td>
      <td width="29%" height="19">
        <p align="center"><input type="radio" name="sondage" value="p4"></td>
      <td width="42%" height="19">Vote 1</td>
    </tr>
    <tr>
      <td width="45%" height="19">
        <p align="center"><input type="radio" name="sondage" value="p2"></td>
      <td width="29%" height="19">
        <p align="center"><input type="radio" name="sondage" value="p5"></td>
      <td width="42%" height="19">Vote 2</td>
    </tr>
    <tr>
      <td width="45%" height="19">
        <p align="center"><input type="radio" name="sondage" value="p3"></td>
      <td width="29%" height="19">
        <p align="center"><input type="radio" name="sondage" value="p6"></td>
      <td width="42%" height="19">Vote 3</td>
    </tr>
    <tr>
      <td width="24%" colspan="2" height="1">
        <p align="center"><input type="submit" value="Valider"></td>
      <td width="42%" height="1"></td>
    </tr>
  </table>
</form>
</body>
</html>


-----------------------------------------------------------------------------------------Sondagee.php
¯¯¯¯¯¯¯¯¯¯¯¯¯
Voila c la ou est tout le code php
-----------------------------------------------------------------------------------------
<?
include('connect.inc');
$connect=mysql_connect($hote,$user,$pass);
$base = mysql_select_db("sondage");
$mareq="select * from ".$sondage."";
$resultat=mysql_query($mareq);
$nbre=mysql_numrows($resultat);
$nb = $nbre + 1;
mysql_query("insert into $sondage(nb) values ('$nb')");
for ($i = 1; $i <=6; $i++)
	{
		$pi = "p$i";
		$mareq ="select * from p$i";
		$resultat=mysql_query($mareq);
		$$pi = mysql_numrows($resultat);
	}
?>
<html>
<body>

<p>&nbsp;</p>
<p>&nbsp;</p>

<form action="sondage.php">
  <table border="1" width="22%">
    <tr>
      <td width="37%">POUR</td>
      <td width="25%">CONTRE</td>
      <td width="27%">&nbsp;</td>
    </tr>
    <tr>
      <td width="37%"><? echo $p1; ?>
	  </td>
      <td width="25%"><? echo $p4; ?></td>
      <td width="27%">Vote 1</td>
    </tr>
    <tr>
      <td width="37%"><? echo $p2; ?></td>
      <td width="25%"><? echo $p5; ?></td>
      <td width="27%">Vote 2</td>
    </tr>
    <tr>
      <td width="37%"><? echo $p3; ?></td>
      <td width="25%"><? echo $p6; ?></td>
      <td width="27%">Vote 3</td>
    </tr>
    <tr>
      <td width="39%" colspan="2">
        <form method="POST" action="--WEBBOT-SELF--">
  <p><a href="sondage.php"><input type="button" value="Changer de vote" name="B3"></a></p>
</form>
      <td width="27%">&nbsp;</td>
    </tr>
  </table>
</form>
<p><a href="sondage.php">test</a></p>
</body>
</html>

 Conclusion

Alors vous en pancé koi ? (n'oublié pas que c mon 1ere code :-/)


 Sources du même auteur

ESPACE MEMBRE !

 Sources de la même categorie

Source avec Zip Source avec une capture VALIDATEUR DE FORMULAIRE par Reldan
Source avec Zip SUIVI SERVICE CLIENT PHP par hige52
Source avec Zip POO - FORMULAIRE NEWSLETTER PHP - PROFESSEUR-PHP.COM par mtrix000
Source avec Zip Source avec une capture SELECTEUR DE NOTE par Reldan
Source avec Zip Source avec une capture ESPACE MEMBRE , AVEC CASE OPTIONNEL , SANS MYSQL par sartoz

Commentaires et avis

Commentaire de revinc le 12/06/2003 13:13:53

efficace mais on peut voter 5000000000 de fois...

Commentaire de ekinoks le 12/06/2003 15:07:41

Commentaire de gium le 12/06/2003 19:15:23

Commentaire de ekinoks le 13/06/2003 00:42:43

Commentaire de Isengard le 19/06/2003 22:16:55

Commentaire de la_pin le 11/02/2005 13:12:26

coté php c'est correct mais coté français ya du pain sur la planche... ^^

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,406 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales