8791 sujets

Développement web côté serveur, CMS

Pages :
(reprise du message précédent)

Désolé, j'ai bien les modifs suggérés mais toujours meme resultat : page blanche.

On a egalement essayé de scinder en deux le formulaire avec d'un coté l'entrée des données et de l'autre l'inclusion dans la base de données.

Dans ce cas le premier formulaire fonctionne mais ne renvoie rien qu'une page blanche et aucune inclusion dans la BDD. Ceci avec l'aide forte et très apprécié de valoo.

Effectivement je commence a me poser fortement la question d'un changement d'hébergeur.

Merci a tous encore une fois

Lonewolf
Rebonjour a tous,

J'ai donc repris le formulaire de Valoo pour tester une dernière fois et la surprise, si je commente la partie sql ca fonctionne donc le problème de code doit se trouver à cet endroit.

Je le regarde pour voir si je trouve ce qui coince. Si vous voyer quelque chose qui peut expliquer l'echec de la page lorsque je décommente faites m'en part.

Merci d'avance

Lonewolf

[Edit] je vous joins une image de ma BDD au cas ou ce serait elle qui serait en cause
upload/16311-Capture-lo.png
Modifié par lonewolf (27 Apr 2008 - 18:38)
voila remplace ta partie sql par celle ci teste pour voir si sa marche

<?php
// info pour la connexion
$host_db = "localhost";//host
$login_db = "***";//login
$pass_db = "***";//mot de passe
$db_db = "***";//nom de la base

	//script de connexion plus complet que le tien (c'est celui que j'utilisai pour tous mes sites quand je fonctionnais sous mysql mintenant je suis postgresql qui est plus puissant mais plus compliqué)
	$mysql_host="" . $host_db . ""; 
	$mysql_login="" . $login_db . ""; 
	$mysql_pass="" . $pass_db . ""; 
	$mysql_dbnom="" . $db_db . ""; 
	$db=mysql_connect($mysql_host,$mysql_login,$mysql_pass); //connexion a la base
	mysql_select_db($mysql_dbnom,$db);// selection de base
	
// insertion sql
$sql = mysql_query("INSERT INTO co-voiturage ( `ID` , `Nom` , `Prenom` , `Adresse` , `Telephone` , `Destination` , `HeureDepart` , `HeureRetour` , `Lundi` , `Mardi` , `Mercredi` , `Jeudi` , `Vendredi` , `Samedi` , `Dimanche` ) VALUES ( '', '" . $Nom . "' , '" . $Prenom . "' , '" . $Adresse . "' , '" . $Telephone . "' , '" . $Destination . "' , '" . $HeureDepart . "' , '" . $HeureRetour . "' , '" . $Lundi . "' , '" . $Mardi . "' , '" . $Mercredi . "' , '" . $Jeudi . "' , '" . $Vendredi . "' , '" . $Samedi . "' , '" . $Dimanche . "')");?>

Modifié par valoo49 (27 Apr 2008 - 19:49)
Bonjour Valoo et merci encore

alors le resultat :

- si je laisse ton code avec <?php ?> = page blanche
- si je les enleve = la page s'affiche mais aucune inclusion dans la bdd

Smiley decu

Amitiés

Lonewolf

Smiley edit
Une chose me choque. Tu utilise la variable $sql pour l'insertion des données mais tu ne fais pas appel à cette variable après. Est ce normal ?

De plus, j'utilise la coloration syntaxique et je constate que le ?> après l'insertion des données est en couleur différente si je laisse les <?php ?> que tu as mis. Mais lorsque je les compte, il y a bien le même nombre de <?php et de ?>. C'est bizarre non ?
Modifié par lonewolf (28 Apr 2008 - 09:11)
Pour la var $sql c'est une abitute de codage ...

pour le problème de balise tu ne peut reouvrir une <?php si la presedente n'es pas fermé.
Valoo, voici le code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">



<head>

  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />

  <title>co-voiturage</title>

</head>

<body>

<?php if (empty($_POST))

	{

	?>

<br />

<br />

<br />

<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="inscription">

<div align="center">

<table width="314" border="0">

  <tr>

    <td width="162">Nom :</td>

    <td width="11"> </td>

    <td width="127"><input

 name="Nom" /></td>

  </tr>

  <tr>

    <td>Prénom :</td>

    <td> </td>

    <td><input

 name="Prenom" /></td>

  </tr>

  <tr>

    <td>Adresse :</td>

    <td> </td>

    <td><input

 name="Adresse" /></td>

  </tr>

  <tr>

    <td>Téléphone :</td>

    <td> </td>

    <td><input

 name="Telephone" /></td>

  </tr>

  <tr>

    <td>Destination : </td>

    <td> </td>

    <td><input

 name="Destination" /></td>

  </tr>

  <tr>

    <td>Heure de départ: </td>

    <td> </td>

    <td><input name="HeureDepart" /></td>

  </tr>

  <tr>

    <td>Heure de retour : </td>

    <td> </td>

    <td><input name="HeureRetour" /></td>

  </tr>

</table>

</div>

<br />

<br />

<div align="center">

 <table width="200" border="0">

   <tr>

     <td><strong>Jour travaillé : </strong></td>

   </tr>

   <tr>

     <td>Lundi</td>

     <td> </td>

     <td><input name="Lundi" type="checkbox" /></td>

   </tr>

   <tr>

     <td>Mardi</td>

     <td> </td>

     <td><input name="Mardi" type="checkbox" /></td>

    </tr> 

	 <tr>

     <td>Mercredi</td>

	 <td> </td>

     <td><input name="Mercredi"

 type="checkbox" /></td>

   </tr>

   <tr>

     <td>Jeudi</td>

     <td> </td>

     <td><input name="Jeudi"

 type="checkbox" /></td>

   </tr>

   <tr>

     <td> Vendredi</td>

     <td> </td>

     <td>

       <input name="Vendredi"

 type="checkbox" /></td>

   </tr>

   <tr>

     <td> Samedi </td>

     <td> </td>

     <td><input name="Samedi"

 type="checkbox" /></td>

   </tr>

   <tr>

     <td>  Dimanche</td>

     <td> </td>

     <td>

       <input name="Dimanche"

 type="checkbox" /></td>

   </tr>

 </table>

</div>        

<br />

<div align="center">

<input name="Validation" type="submit" /> 

<input name="Reset" type="reset" />

</div>

</form>





<?php } 



if (!empty($_POST))

{

//Recup des variables.

$Nom = $_POST['Nom'];

$Prenom = $_POST['Prenom'];

$Adresse = $_POST['Adresse'];

$Telephone = $_POST['Telephone'];

$Destination = $_POST['Destination'];

$HeureDepart = $_POST['HeureDepart'];

$HeureRetour = $_POST['HeureRetour'];

$Lundi = $_POST['Lundi'];

$Mardi = $_POST['Mardi'];

$Mercredi = $_POST['Mercredi'];

$Jeudi = $_POST['Jeudi'];

$vendredi = $_POST['Vendredi'];

$Samedi = $_POST['Samedi'];

$Dimanche = $_POST['Dimanche'];



// Modif des varibles

if ($Lundi == 'on') $Lundi = 'oui';

else $Lundi = 'non';

if ($Mardi == 'on') $Mardi = 'oui';

else $Mardi = 'non';

if ($Mercredi == 'on') $Mercredi = 'oui';

else $Mercredi = 'non';

if ($Jeudi == 'on') $Jeudi = 'oui';

else $Jeudi = non;

if ($Vendredi == 'on')  $Vendredi = 'oui';

else $Vendredi = 'non';

if ($Samedi == 'on') $Samedi = 'oui';

else $Samedi = 'non';

if ($Dimanche == 'on') $Dimanche = 'oui';

else $Dimanche = 'non'; 





	<?php

// info pour la connexion

$host_db = "localhost";//host

$login_db = "***";//login

$pass_db = "***";//mot de passe

$db_db = "***";//nom de la base



	//script de connexion plus complet que le tien (c'est celui que j'utilisai pour tous mes sites quand je fonctionnais sous mysql mintenant je suis postgresql qui est plus puissant mais plus compliqué)

	$mysql_host="" . $host_db . ""; 

	$mysql_login="" . $login_db . ""; 

	$mysql_pass="" . $pass_db . ""; 

	$mysql_dbnom="" . $db_db . ""; 

	$db=mysql_connect($mysql_host,$mysql_login,$mysql_pass); //connexion a la base

	mysql_select_db($mysql_dbnom,$db);// selection de base

	

// insertion sql

$sql = mysql_query("INSERT INTO co-voiturage ( `ID` , `Nom` , `Prenom` , `Adresse` , `Telephone` , `Destination` , `HeureDepart` , `HeureRetour` , `Lundi` , `Mardi` , `Mercredi` , `Jeudi` , `Vendredi` , `Samedi` , `Dimanche` ) VALUES ( '', '" . $Nom . "' , '" . $Prenom . "' , '" . $Adresse . "' , '" . $Telephone . "' , '" . $Destination . "' , '" . $HeureDepart . "' , '" . $HeureRetour . "' , '" . $Lundi . "' , '" . $Mardi . "' , '" . $Mercredi . "' , '" . $Jeudi . "' , '" . $Vendredi . "' , '" . $Samedi . "' , '" . $Dimanche . "')");?>

?>

<!-- On peut aussi faire un tableau recap -->



<table width="981" border="1" cellspacing="0" cellpadding="0">

  <tr>

    <td width="62"><div align="center">Prenom</div></td>

    <td width="62"><div align="center">Nom</div></td>

    <td width="71"><div align="center">Adresse</div></td>

    <td width="73"><div align="center">Téléphone</div></td>

    <td width="80"><div align="center">Destination</div></td>

    <td width="86"><div align="center">Hr de depart</div></td>

    <td width="89"><div align="center">Hr de retour</div></td>

    <td width="59"><div align="center">Lundi</div></td>

    <td width="63"><div align="center">Mardi</div></td>

    <td width="77"><div align="center">Mercredi</div></td>

    <td width="56"><div align="center">Jeudi</div></td>

    <td width="72"><div align="center">Vendredi</div></td>

    <td width="57"><div align="center">Samedi</div></td>

    <td width="74"><div align="center">Dimanche</div></td>

  </tr>

  <tr>

    <td><?php echo $Prenom;?></td>

    <td><?php echo $Nom;?></td>

    <td><?php echo $Adresse;?></td>

    <td><?php echo $Telephone;?></td>

    <td><?php echo $Destination;?></td>

    <td><?php echo $HeureDepart;?></td>

    <td><?php echo $HeureRetour;?></td>

    <td><?php echo $Lundi;?>;</td>

    <td><?php echo $Mardi;?></td>

    <td><?php echo $Mercredi;?></td>

    <td><?php echo $Jeudi;?></td>

    <td><?php echo $Vendredi;?></td>

    <td><?php echo $Samedi;?></td>

    <td><?php echo $Dimanche;?></td>

  </tr>

</table>

<?php }?>

</body>

</html>
Voila enfaite tu avait re-ouvert la balise <?php dans un balise <?php deja ouverte donc beug .....

En espérant que sa marche ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">



<head>

  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />

  <title>co-voiturage</title>

</head>

<body>

<?php if (empty($_POST))

	{

	?>

<br />

<br />

<br />

<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="inscription">

<div align="center">

<table width="314" border="0">

  <tr>

    <td width="162">Nom :</td>

    <td width="11"> </td>

    <td width="127"><input

 name="Nom" /></td>

  </tr>

  <tr>

    <td>Prénom :</td>

    <td> </td>

    <td><input

 name="Prenom" /></td>

  </tr>

  <tr>

    <td>Adresse :</td>

    <td> </td>

    <td><input

 name="Adresse" /></td>

  </tr>

  <tr>

    <td>Téléphone :</td>

    <td> </td>

    <td><input

 name="Telephone" /></td>

  </tr>

  <tr>

    <td>Destination : </td>

    <td> </td>

    <td><input

 name="Destination" /></td>

  </tr>

  <tr>

    <td>Heure de départ: </td>

    <td> </td>

    <td><input name="HeureDepart" /></td>

  </tr>

  <tr>

    <td>Heure de retour : </td>

    <td> </td>

    <td><input name="HeureRetour" /></td>

  </tr>

</table>

</div>

<br />

<br />

<div align="center">

 <table width="200" border="0">

   <tr>

     <td><strong>Jour travaillé : </strong></td>

   </tr>

   <tr>

     <td>Lundi</td>

     <td> </td>

     <td><input name="Lundi" type="checkbox" /></td>

   </tr>

   <tr>

     <td>Mardi</td>

     <td> </td>

     <td><input name="Mardi" type="checkbox" /></td>

    </tr> 

	 <tr>

     <td>Mercredi</td>

	 <td> </td>

     <td><input name="Mercredi"

 type="checkbox" /></td>

   </tr>

   <tr>

     <td>Jeudi</td>

     <td> </td>

     <td><input name="Jeudi"

 type="checkbox" /></td>

   </tr>

   <tr>

     <td> Vendredi</td>

     <td> </td>

     <td>

       <input name="Vendredi"

 type="checkbox" /></td>

   </tr>

   <tr>

     <td> Samedi </td>

     <td> </td>

     <td><input name="Samedi"

 type="checkbox" /></td>

   </tr>

   <tr>

     <td>  Dimanche</td>

     <td> </td>

     <td>

       <input name="Dimanche"

 type="checkbox" /></td>

   </tr>

 </table>

</div>        

<br />

<div align="center">

<input name="Validation" type="submit" /> 

<input name="Reset" type="reset" />

</div>

</form>





<?php } 



if (!empty($_POST))

{

//Recup des variables.

$Nom = $_POST['Nom'];

$Prenom = $_POST['Prenom'];

$Adresse = $_POST['Adresse'];

$Telephone = $_POST['Telephone'];

$Destination = $_POST['Destination'];

$HeureDepart = $_POST['HeureDepart'];

$HeureRetour = $_POST['HeureRetour'];

$Lundi = $_POST['Lundi'];

$Mardi = $_POST['Mardi'];

$Mercredi = $_POST['Mercredi'];

$Jeudi = $_POST['Jeudi'];

$vendredi = $_POST['Vendredi'];

$Samedi = $_POST['Samedi'];

$Dimanche = $_POST['Dimanche'];



// Modif des varibles

if ($Lundi == 'on') $Lundi = 'oui';

else $Lundi = 'non';

if ($Mardi == 'on') $Mardi = 'oui';

else $Mardi = 'non';

if ($Mercredi == 'on') $Mercredi = 'oui';

else $Mercredi = 'non';

if ($Jeudi == 'on') $Jeudi = 'oui';

else $Jeudi = non;

if ($Vendredi == 'on')  $Vendredi = 'oui';

else $Vendredi = 'non';

if ($Samedi == 'on') $Samedi = 'oui';

else $Samedi = 'non';

if ($Dimanche == 'on') $Dimanche = 'oui';

else $Dimanche = 'non'; 



// info pour la connexion

$host_db = "localhost";//host

$login_db = "***";//login

$pass_db = "***";//mot de passe

$db_db = "***";//nom de la base



	//script de connexion plus complet que le tien (c'est celui que j'utilisai pour tous mes sites quand je fonctionnais sous mysql mintenant je suis postgresql qui est plus puissant mais plus compliqué)

	$mysql_host="" . $host_db . ""; 

	$mysql_login="" . $login_db . ""; 

	$mysql_pass="" . $pass_db . ""; 

	$mysql_dbnom="" . $db_db . ""; 

	$db=mysql_connect($mysql_host,$mysql_login,$mysql_pass); //connexion a la base

	mysql_select_db($mysql_dbnom,$db);// selection de base

	

// insertion sql

$sql = mysql_query("INSERT INTO co-voiturage ( `ID` , `Nom` , `Prenom` , `Adresse` , `Telephone` , `Destination` , `HeureDepart` , `HeureRetour` , `Lundi` , `Mardi` , `Mercredi` , `Jeudi` , `Vendredi` , `Samedi` , `Dimanche` ) VALUES ( '', '" . $Nom . "' , '" . $Prenom . "' , '" . $Adresse . "' , '" . $Telephone . "' , '" . $Destination . "' , '" . $HeureDepart . "' , '" . $HeureRetour . "' , '" . $Lundi . "' , '" . $Mardi . "' , '" . $Mercredi . "' , '" . $Jeudi . "' , '" . $Vendredi . "' , '" . $Samedi . "' , '" . $Dimanche . "')");
?>

<!-- On peut aussi faire un tableau recap -->



<table width="981" border="1" cellspacing="0" cellpadding="0">

  <tr>

    <td width="62"><div align="center">Prenom</div></td>

    <td width="62"><div align="center">Nom</div></td>

    <td width="71"><div align="center">Adresse</div></td>

    <td width="73"><div align="center">Téléphone</div></td>

    <td width="80"><div align="center">Destination</div></td>

    <td width="86"><div align="center">Hr de depart</div></td>

    <td width="89"><div align="center">Hr de retour</div></td>

    <td width="59"><div align="center">Lundi</div></td>

    <td width="63"><div align="center">Mardi</div></td>

    <td width="77"><div align="center">Mercredi</div></td>

    <td width="56"><div align="center">Jeudi</div></td>

    <td width="72"><div align="center">Vendredi</div></td>

    <td width="57"><div align="center">Samedi</div></td>

    <td width="74"><div align="center">Dimanche</div></td>

  </tr>

  <tr>

    <td><?php echo $Prenom;?></td>

    <td><?php echo $Nom;?></td>

    <td><?php echo $Adresse;?></td>

    <td><?php echo $Telephone;?></td>

    <td><?php echo $Destination;?></td>

    <td><?php echo $HeureDepart;?></td>

    <td><?php echo $HeureRetour;?></td>

    <td><?php echo $Lundi;?>;</td>

    <td><?php echo $Mardi;?></td>

    <td><?php echo $Mercredi;?></td>

    <td><?php echo $Jeudi;?></td>

    <td><?php echo $Vendredi;?></td>

    <td><?php echo $Samedi;?></td>

    <td><?php echo $Dimanche;?></td>

  </tr>

</table>

<?php }?>

</body>

Hello, et Alleluiaaaaaaaaaaaaaa

J'ai juste réparé une erreur (sur le INSERT INTO co-voiturage alors que c'est covoiturage) et ca fonctionne.

Merci BEAUCOUP A TOUS et surtout à toi valoo.

Maintenant, il ne me reste plus qu'a créer une page qui renvoie tous les inscrits et ca sera parfait.

Merci encore a tous

Amitiés

Lonewolf
Pages :