Ghettobusta Posted April 17, 2007 Share Posted April 17, 2007 I need to give this in in exactly 4 hours... The website is: http://cogito.labos.polymtl.ca/~ti317/TS2/ I have to validate it on http://validator.w3.org/ When I try to validate http://cogito.labos.polymtl.ca/~ti317/TS2/index.php and http://cogito.labos.polymtl.ca/~ti317/TS2/visionner.php I get more than 700 errors... there must be a little mistake in my code that does this... it's impossible I really made 700 mistakes. I copy pasted some code from Index to Visionner... so I'm pretty sure the problem comes from the code that is the same in both. I REALLY NEED URGENT HELP ON THIS PLEASE!! My index: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Forum de discussion sur les technologies de l'information</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="titre">Le forum des technologies de l'information</div> <table id="menu1"> <tr> <td id="menu2"><a href="index.php">Accueil</a></td> </tr> <tr> <td id="menu2"><a href="guide.html">Guide d'utilisation</a></td> </tr> <tr> <td id="menu2"><a href="inscription.php">S'inscrire</a></td> </tr> <tr> <td id="menu2"><a href="sujet.php">Ajouter un sujet</a></td> </tr> <tr> <td id="menu2"><a href="intervention.php">Répondre à un sujet</a></td> </tr> </table> <div><br/></div> <p id="paragraphe">Bienvenue sur 'Le forum des technologies de l'information'. Ce forum vise à receuillir divers opinions par rapport à la place que prennent les <a href="http://fr.wikipedia.org/wiki/Technologie_de_l%27information">technologies de l'information</a> dans la société actuelle. Veuillez prendre note que vous devez vous <a href="inscription.html">inscrire</a> afin de pouvoir faire valoir votre propre opinion. Nous vous remercions de votre visite.</p> <p id="text">Veuillez choisir un sujet:</p> <form action="visionner.php" method="post"> <p id="text"> <select name="sujet"> <?php //------------------------------ // Connexion à la base de données $adresse_serveur='-'; $compte_mysql='-'; $mot_de_passe_mysql='-'; $lien_bd=mysql_connect($adresse_serveur, $compte_mysql, $mot_de_passe_mysql); if (!$lien_bd) {print("<strong>Impossible de se connecter au serveur MySQL: </strong>" . mysql_error()); exit();} //------------------------------ // Sélection de la base de données $nom_bd='H2007'; if (!mysql_select_db($nom_bd, $lien_bd)) {print("<strong>Impossible d'utiliser la base de données $nom_bd : </strong>" . mysql_error()); exit();} //------------------------------ // Exécution de la requête sur une base de données précise $requete="SELECT * FROM Sujets ORDER BY Sid DESC"; $resultat=mysql_query($requete, $lien_bd); if (!$resultat) {print("<strong>Erreur lors du traitement de la requête : </strong>" . mysql_error()); exit();} //------------------------------ // Récupération des données if (mysql_num_rows($resultat) > 0) { while ($enregistrement = mysql_fetch_array($resultat)) { if ($enregistrement['Stexte']!="") { print "<option value=".$enregistrement['Sid']."\">".$enregistrement['Sid'].". ".$enregistrement['Stexte']."</option>";}}} ?> </select><br> <input type="submit" value="Visionner"/> </p> </form> <br/><br/><br/><br/> <p id="webmestres">Ce site a été créé par <a href="mailto:alexandre.kheir@polymtl.ca">Alexandre Kheir</a> et <a href="mailto:Elie.Agha@polymtl.ca">Elie Agha</a> (équipe 317), Élèves de <a href="www.polymtl.ca">l'École Polytechnique de Montréal</a><br/> NB: Pour pouvoir pleinement profiter de ce site, une résolution de 1024 x 760 est préférable</p> </body> </html> My visionner: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Forum de discussion sur les technologies de l'information</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="titre">Le forum des technologies de l'information</div> <table id="menu1"> <tr> <td id="menu2"><a href="index.php">Accueil</a></td> </tr> <tr> <td id="menu2"><a href="guide.html">Guide d'utilisation</a></td> </tr> <tr> <td id="menu2"><a href="inscription.php">S'inscrire</a></td> </tr> <tr> <td id="menu2"><a href="sujet.php">Ajouter un sujet</a></td> </tr> <tr> <td id="menu2"><a href="intervention.php">Répondre à un sujet</a></td> </tr> </table> <br/> <p id="text"> <?php "Subject value -> " . $_POST['sujet'] . "<br/>"; //------------------------------ // Connexion à la base de données $adresse_serveur='-'; $compte_mysql='-'; $mot_de_passe_mysql='-'; $lien_bd=mysql_connect($adresse_serveur, $compte_mysql, $mot_de_passe_mysql); if (!$lien_bd) {print("<strong>Impossible de se connecter au serveur MySQL: </strong>" . mysql_error()); exit();} //------------------------------ // Sélection de la base de données $nom_bd='H2007'; if (!mysql_select_db($nom_bd, $lien_bd)) {print("<strong>Impossible d'utiliser la base de données $nom_bd : </strong>" . mysql_error()); exit();} //------------------------------ // Exécution de la requête sur une base de données précise $requete="SELECT `Ctexte`,`Cdate`, `Unom` FROM `Commentaires`, `Usagers` WHERE CUid=Uid AND CSid='".$_POST['sujet']."'"; $resultat=mysql_query($requete, $lien_bd); if (!$resultat) {print("<strong>Erreur lors du traitement de la requête : </strong>" . mysql_error()); exit();} $requete2="SELECT `Stexte`,`Sid` FROM `Sujets` WHERE Sid='".$_POST['sujet']."'"; $resultat2=mysql_query($requete2, $lien_bd); while ($enregistrement2 = mysql_fetch_array($resultat2)){ print "<strong>Sujet #".$enregistrement2['Sid'].": ".$enregistrement2['Stexte'].":</strong><br/>"; print "-----------------------------------------------------------------------------<br/>";} //------------------------------ // Récupération des données if (mysql_num_rows($resultat) == 0) {print "Il n'y a aucun commentaire sur ce sujet<br/>"; print "-----------------------------------------------------------------------------<br/>";} else { while ($enregistrement = mysql_fetch_array($resultat)) { if ($enregistrement['Ctexte']!=""){ print "<strong>Nom: </strong>".$enregistrement['Unom']."<br/>"; print "<strong>Date: </strong>".$enregistrement['Cdate']."<br/>"; print "<strong>Commentaire: </strong>".$enregistrement['Ctexte']."<br/>"; print "-----------------------------------------------------------------------------<br/>";}} }?> <br/>Veuillez choisir un autre sujet: <form action="visionner.php" method="POST"> <p id="text"> <select name="sujet"> <?php //------------------------------ // Connexion à la base de donnée $adresse_serveur='localhost'; $compte_mysql='tixxx'; $mot_de_passe_mysql='MEC1310'; $lien_bd=mysql_connect($adresse_serveur, $compte_mysql, $mot_de_passe_mysql); if (!$lien_bd) {print("<strong>Impossible de se connecter au serveur MySQL: </strong>" . mysql_error()); exit();} //------------------------------ // Sélection de la base de donnée $nom_bd='H2007'; if (!mysql_select_db($nom_bd, $lien_bd)) {print("<strong>Impossible d'utiliser la base de données $nom_bd : </strong>" . mysql_error()); exit();} //------------------------------ // Exécution de la requête sur une base de donnée précise $requete="SELECT * FROM Sujets ORDER BY Sid DESC"; $resultat=mysql_query($requete, $lien_bd); if (!$resultat) {print("<strong>Erreur lors du traitement de la requête : </strong>" . mysql_error()); exit();} //------------------------------ // Récupération des données if (mysql_num_rows($resultat) > 0) { while ($enregistrement = mysql_fetch_array($resultat)) { if ($enregistrement['Stexte']!="") { print "<option value=". $enregistrement['Sid'] ."\">".$enregistrement['Sid'].". ".$enregistrement['Stexte']."</option>";}}} ?> </select><br> <input type="submit" value="Visionner"/> </p> </form> </p> <br/> <p id="webmestres">Ce site a été créé par <a href="mailto:alexandre.kheir@polymtl.ca">Alexandre Kheir</a> et <a href="mailto:Elie.Agha@polymtl.ca">Elie Agha</a> (équipe 317), Élèves de <a href="www.polymtl.ca">l'École Polytechnique de Montréal</a><br/> NB: Pour pouvoir pleinement profiter de ce site, une résolution de 1024 x 760 est préférable</p> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/ Share on other sites More sharing options...
suzzane2020 Posted April 17, 2007 Share Posted April 17, 2007 You mite have the same error repeatin cud u tell us any one of the errors? Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231147 Share on other sites More sharing options...
only one Posted April 17, 2007 Share Posted April 17, 2007 lol silly idea pasting your password... your gonna get hacked, better change it quick dude! Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231150 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 http://validator.w3.org/check?uri=http%3A%2F%2Fcogito.labos.polymtl.ca%2F%7Eti317%2FTS2%2Findex.php I know this doesn't have to do with php... but I don't know what to do with the ID errors either...? Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231151 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 well first off change all your id="menu2" to class="menu2" then open up your css file and change the id menu2 to a class.. (generally using '.' instead of '#') Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231159 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 Thanks. That was a good start. Now I'm pretty sure that what is generating the 750 errors is in this part of the code: Can someone check it out? I'd appreciate it A LOT!!! <form action="visionner.php" method="POST"> <p id="text"> <select name="sujet"> <?php //------------------------------ // Connexion à la base de donnée $adresse_serveur='localhost'; $compte_mysql='tixxx'; $mot_de_passe_mysql='MEC1310'; $lien_bd=mysql_connect($adresse_serveur, $compte_mysql, $mot_de_passe_mysql); if (!$lien_bd) {print("<strong>Impossible de se connecter au serveur MySQL: </strong>" . mysql_error()); exit();} //------------------------------ // Sélection de la base de donnée $nom_bd='H2007'; if (!mysql_select_db($nom_bd, $lien_bd)) {print("<strong>Impossible d'utiliser la base de données $nom_bd : </strong>" . mysql_error()); exit();} //------------------------------ // Exécution de la requête sur une base de donnée précise $requete="SELECT * FROM Sujets ORDER BY Sid DESC"; $resultat=mysql_query($requete, $lien_bd); if (!$resultat) {print("<strong>Erreur lors du traitement de la requête : </strong>" . mysql_error()); exit();} //------------------------------ // Récupération des données if (mysql_num_rows($resultat) > 0) { while ($enregistrement = mysql_fetch_array($resultat)) { if ($enregistrement['Stexte']!="") { print "<option value=". $enregistrement['Sid'] ."\">".$enregistrement['Sid'].". ".$enregistrement['Stexte']."</option>";}}} ?> </select><br> <input type="submit" value="Visionner"/> </p> </form> Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231173 Share on other sites More sharing options...
AndyB Posted April 17, 2007 Share Posted April 17, 2007 NEED HELP URGENT ... don't do that. Using all caps is like shouting, i.e. rude, and URGENT isn't a problem for anyone but you. Free help is what you get here. If it's URGENT, then the freelancing forum is the place to post, i.e. offer something in return for meeting your urgent requirements. As you noted, this isn't about php. Why did you post in this forum, when it belongs in the html/css help forum (which is where I'm moving it). BTW, I doubt that 20 or so lines of php are responsible for 750 html errors ... but the validator output will help you determine what those errors are. Please respect the forum guidelines. Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231175 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 Sorry. I'm new and didn't have time to read all the forum rules... this is due very soon. I'll be careful next time. The thing is this does have to do with php... because I'm pretty sure my php code is generating all those errors... They all come from the drop-down menu. The only other errors I have are all like this one: Error Line 60 column 2: end tag for "p" omitted, but OMITTAG NO was specified. The validator doesn't seem to see that I closed those tags AFTER the php code... is there a way to fix this? Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231187 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 another thing is changing all the values in the options. value=2270" is incorrect. You need two ". for example value="2270" I think you'll find that it will solve most of your problems Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231190 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 Yes but those are all generated by my php code... and I'm a php newbie Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231191 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 Is there something wrong with this line? print "<option value=".$enregistrement['Sid']."\">".$enregistrement['Sid'].". ".$enregistrement['Stexte']."</option>"; Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231192 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 find this line: print "<option value=".$enregistrement['Sid']."\">".$enregistrement['Sid'].". ".$enregistrement['Stexte']."</option>";}}} change it to print "<option value=\"".$enregistrement['Sid']."\">".$enregistrement['Sid'].". ".$enregistrement['Stexte']."</option>";}}} just a tiny change. Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231193 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 Thanks a lot man!! That's reeeeeeeaaallly appreciated!! Do you have an idea for the errors like this?: Error Line 60 column 2: end tag for "p" omitted, but OMITTAG NO was specified. They're the only errors I have left Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231198 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 find line 58.. it's the </select> line ?> </select><br> <input type="submit" value="Visionner"/> just change the above to this: ?> </select><br /> <input type="submit" value="Visionner"/> should work Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231202 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 Thanks a lot! If I can ask you a last thing... I'm getting these errors for my "visionner.php": http://validator.w3.org/check?uri=http%3A%2F%2Fcogito.labos.polymtl.ca%2F%7Eti317%2FTS2%2Fvisionner.php&charset=%28detect+automatically%29&doctype=Inline And I am getting the same three errors for my "inscription.php", "intervention.php" and "sujet.php": http://validator.w3.org/check?uri=http%3A%2F%2Fcogito.labos.polymtl.ca%2F%7Eti317%2FTS2%2Finscription.php&charset=%28detect+automatically%29&doctype=Inline Here is my "inscription.php"... I guess if I fix the errors in this one, It will be teh same thing in the 2 others: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Forum de discussion sur les technologies de l'information</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="titre">Le forum des technologies de l'information</div> <table class="menu1"> <tr> <td class="menu2"><a href="index.php">Accueil</a></td> </tr> <tr> <td class="menu2"><a href="guide.html">Guide d'utilisation</a></td> </tr> <tr> <td class="menu2"><a href="inscription.php">S'inscrire</a></td> </tr> <tr> <td class="menu2"><a href="sujet.php">Ajouter un sujet</a></td> </tr> <tr> <td class="menu2"><a href="intervention.php">Répondre à un sujet</a></td> </tr> </table> <div><br/></div> <p class="text">Veuillez remplir le formulaire ci-dessous si vous désirez vous inscrire afin de faire valoir votre opinion sur notre merveilleux forum:</p> <form action="inscription.php" method="post"> <div><input type="hidden" name="hidden" value="1" /></div> <table class="table"> <tr> <td>Nom d'utilisateur*: </td> <td class="input"><input type="text" maxlength="12" name="username" size="20"/></td> </tr> <tr> <td>Mot de passe*: </td> <td class="input"><input type="password" maxlength="12" name="password" size="20"/></td> </tr> <tr> <td>Confirmation du Mot de passe*: </td> <td class="input"><input type="password" maxlength="12" name="password2" size="20"/></td> </tr> <tr> <td>Courriel: </td> <td class="input"><input type="text" name="courriel" size="20"/></td> </tr> <tr> <td></td> <td><input type="submit" value="S'inscrire"/></td> </tr> </table> </form> <div class="text"><br/>* : champ obligatoire.<br/> NB: Votre nom d'utilisateur et mot de passe doivent strictement être composés de caractères alphanumériques ou de la barre de soulignement.</div> <div><br/></div> <p class="webmestres">Ce site a été créé par <a href="mailto:alexandre.kheir@polymtl.ca">Alexandre Kheir</a> et <a href="mailto:Elie.Agha@polymtl.ca">Elie Agha</a> (équipe 317), Élèves de <a href="http://www.polymtl.ca/">l'École Polytechnique de Montréal</a><br/> NB: Pour pouvoir pleinement profiter de ce site, une résolution de 1024 x 760 est préférable</p> <p class="erreur"> <?php $hidden = $_POST['hidden']; $nom = $_POST['username']; $password = $_POST['password']; $password2 = $_POST['password2']; $courriel = $_POST['courriel']; //------------------------------ // Vérification des données entrées if ($hidden!="1") {exit();} if ($nom==""){print("Vous devez entrer un nom d'utilisateur.<br/>"); exit();} if ($password==""){print("Vous devez entrer un mot de passe.<br/>");exit();} if ($password2==""){print("Vous devez confirmer votre mot de passe.<br/>");exit();} if ($password!=$password2){print("Les deux mots de passe ne correspondent pas.<br/>"); exit();} //------------------------------ // Connexion à la base de données $adresse_serveur='localhost'; $compte_mysql='tixxx'; $mot_de_passe_mysql='-'; $lien_bd=mysql_connect($adresse_serveur, $compte_mysql, $mot_de_passe_mysql); if (!$lien_bd) {print("<strong>Impossible de se connecter au serveur MySQL: </strong>" . mysql_error()); exit();} //------------------------------ // Sélection de la base de données $nom_bd='H2007'; if (!mysql_select_db($nom_bd, $lien_bd)) {print("<strong>Impossible d'utiliser la base de données $nom_bd : </strong>" . mysql_error()); exit();} //------------------------------ //Vérification de la disponibilité du username $requete='SELECT * FROM Usagers WHERE Unom="'.$nom.'"'; $resultat=mysql_query($requete, $lien_bd); if (mysql_num_rows($resultat)>0) {print("Ce nom d'utilisateur appartient déjà à quelqu'un, veuillez en choisir un autre.");exit();} //------------------------------ // Exécution de la requête sur une base de donnée précise $requete='INSERT INTO Usagers VALUES(NULL,"'.$nom.'",MD5("'.$password.'"),"'.$courriel.'")'; $resultat=mysql_query($requete, $lien_bd); if (!$resultat) {print("<strong>Erreur lors du traitement de la requête : </strong>" . mysql_error()); exit();} print "Félicitations, la création de votre compte s'est faite avec succès. Veuillez prendre en note votre nom d'utilisateur et votre mot de passe afin de ne pas les égarer.<br/>"; ?></p> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231218 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 all <br> or <br/> should be written as <br /> not the clsong slash and the space between br and /. also, just in case, all code should be in lower case. could you post the code for visionner.php please? Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231225 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <title>Forum de discussion sur les technologies de l'information</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="titre">Le forum des technologies de l'information</div> <table class="menu1"> <tr> <td class="menu2"><a href="index.php">Accueil</a></td> </tr> <tr> <td class="menu2"><a href="guide.html">Guide d'utilisation</a></td> </tr> <tr> <td class="menu2"><a href="inscription.php">S'inscrire</a></td> </tr> <tr> <td class="menu2"><a href="sujet.php">Ajouter un sujet</a></td> </tr> <tr> <td class="menu2"><a href="intervention.php">Répondre à un sujet</a></td> </tr> </table> <div><br/></div> <p class="text"> <?php "Subject value -> " . $_POST['sujet'] . "<br/>"; //------------------------------ // Connexion à la base de données $adresse_serveur='localhost'; $compte_mysql='tixxx'; $mot_de_passe_mysql='-'; $lien_bd=mysql_connect($adresse_serveur, $compte_mysql, $mot_de_passe_mysql); if (!$lien_bd) {print("<strong>Impossible de se connecter au serveur MySQL: </strong>" . mysql_error()); exit();} //------------------------------ // Sélection de la base de données $nom_bd='H2007'; if (!mysql_select_db($nom_bd, $lien_bd)) {print("<strong>Impossible d'utiliser la base de données $nom_bd : </strong>" . mysql_error()); exit();} //------------------------------ // Exécution de la requête sur une base de données précise $requete="SELECT `Ctexte`,`Cdate`, `Unom` FROM `Commentaires`, `Usagers` WHERE CUid=Uid AND CSid='".$_POST['sujet']."'"; $resultat=mysql_query($requete, $lien_bd); if (!$resultat) {print("<strong>Erreur lors du traitement de la requête : </strong>" . mysql_error()); exit();} $requete2="SELECT `Stexte`,`Sid` FROM `Sujets` WHERE Sid='".$_POST['sujet']."'"; $resultat2=mysql_query($requete2, $lien_bd); while ($enregistrement2 = mysql_fetch_array($resultat2)){ print "<strong>Sujet #".$enregistrement2['Sid'].": ".$enregistrement2['Stexte'].":</strong><br/>"; print "-----------------------------------------------------------------------------<br/>";} //------------------------------ // Récupération des données if (mysql_num_rows($resultat) == 0) {print "Il n'y a aucun commentaire sur ce sujet<br/>"; print "-----------------------------------------------------------------------------<br/>";} else { while ($enregistrement = mysql_fetch_array($resultat)) { if ($enregistrement['Ctexte']!=""){ print "<strong>Nom: </strong>".$enregistrement['Unom']."<br/>"; print "<strong>Date: </strong>".$enregistrement['Cdate']."<br/>"; print "<strong>Commentaire: </strong>".$enregistrement['Ctexte']."<br/>"; print "-----------------------------------------------------------------------------<br/>";}} }?> <div><br/>Veuillez choisir un autre sujet:</div> <form action="visionner.php" method="post"> <p class="text"> <select name="sujet"> <?php //------------------------------ // Connexion à la base de donnée $adresse_serveur='localhost'; $compte_mysql='tixxx'; $mot_de_passe_mysql='-'; $lien_bd=mysql_connect($adresse_serveur, $compte_mysql, $mot_de_passe_mysql); if (!$lien_bd) {print("<strong>Impossible de se connecter au serveur MySQL: </strong>" . mysql_error()); exit();} //------------------------------ // Sélection de la base de donnée $nom_bd='H2007'; if (!mysql_select_db($nom_bd, $lien_bd)) {print("<strong>Impossible d'utiliser la base de données $nom_bd : </strong>" . mysql_error()); exit();} //------------------------------ // Exécution de la requête sur une base de donnée précise $requete="SELECT * FROM Sujets ORDER BY Sid DESC"; $resultat=mysql_query($requete, $lien_bd); if (!$resultat) {print("<strong>Erreur lors du traitement de la requête : </strong>" . mysql_error()); exit();} //------------------------------ // Récupération des données if (mysql_num_rows($resultat) > 0) { while ($enregistrement = mysql_fetch_array($resultat)) { if ($enregistrement['Stexte']!="") { print "<option value=\"".$enregistrement['Sid']."\">".$enregistrement['Sid'].". ".$enregistrement['Stexte']."</option>";}}} ?> </select><br/> <input type="submit" value="Visionner"/> </p> </form> </p> <div><br/></div> <p class="webmestres">Ce site a été créé par <a href="mailto:alexandre.kheir@polymtl.ca">Alexandre Kheir</a> et <a href="mailto:Elie.Agha@polymtl.ca">Elie Agha</a> (équipe 317), Élèves de <a href="http://www.polymtl.ca/">l'École Polytechnique de Montréal</a><br/> NB: Pour pouvoir pleinement profiter de ce site, une résolution de 1024 x 760 est préférable</p> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231229 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 The problems on inscription.php are something to do withy the exit; php commands. They are quting the page before it finishes loading, so anything below the php script isn't displaying.. Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231230 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 try changing this line in inscription.php //------------------------------ // Vérification des données entrées if ($hidden!="1") {exit();} to //------------------------------ // Vérification des données entrées if ($hidden!="1") { echo "is this the problem?"; exit();} and see if it echos the statement. If it does, then you know it's that line which is at fault. Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231232 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 Is there a way to fix that? Because if all the information are correctly filled in... the script doesn't exit, and there should be no errors... but the validator doesn't know that Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231234 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 Yes, it echoes... But I need that line so there is nothing written in that space when you just loaded the page. Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231235 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 try changing it to: //------------------------------ // Vérification des données entrées if ($hidden!="1") {} that should leave that space blank. the exit; command stops the server sending anything else past that point. Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231238 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 also... line 64 in visionner.php }?> <div><br />Veuillez choisir un autre sujet:</div> <form action="visionner.php" method="post"> You need to close the <p class="text"> tag that was set above the php code on line 29.. so change line 64 to }?> </p><div><br />Veuillez choisir un autre sujet:</div> <form action="visionner.php" method="post"> then go to line 96 (the one just below the end of the form) and change this: </form> </p> <div><br/></div> to </form> <div><br /></div> Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231239 Share on other sites More sharing options...
Ghettobusta Posted April 17, 2007 Author Share Posted April 17, 2007 try changing it to: //------------------------------ // Vérification des données entrées if ($hidden!="1") {} that should leave that space blank. the exit; command stops the server sending anything else past that point. This doesn't work... because it executes the next command right away... Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231242 Share on other sites More sharing options...
Dragen Posted April 17, 2007 Share Posted April 17, 2007 hmm.. how about: // Vérification des données entrées if ($hidden!="1") {} esleif ($nom==""){print("Vous devez entrer un nom d'utilisateur.<br/>"); exit();} elseif ($password==""){print("Vous devez entrer un mot de passe.<br/>");exit();} elseif ($password2==""){print("Vous devez confirmer votre mot de passe.<br/>");exit();} elseif ($password!=$password2){print("Les deux mots de passe ne correspondent pas.<br/>"); exit();} //------------------------------ or you could try //------------------------------ // Vérification des données entrées if ($hidden!="1") { break; } but I'm not sure if it works for if statements... Quote Link to comment https://forums.phpfreaks.com/topic/47380-validation-need-help-urgent/#findComment-231246 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.