probleme affichage

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : probleme affichage

par charabia » 07 sept. 2006, 20:11

mysql_query("INSERT INTO kit VALUES('', '$mail', '$titre', '$theme', '$couleur', '$police', '$img1', '$img2', '$img3', '$img4', '$admin', '$description')");
dans ta table le titre se trouve avant le mail, donc :
mysql_query("INSERT INTO kit(id,titre,theme,couleur,police,img1,img2,img3,img4,admin,description) VALUES('', '$titre', '$mail', '$theme', '$couleur', '$police', '$img1', '$img2', '$img3', '$img4', '$admin', '$description')");

par Tachikoma » 07 sept. 2006, 19:28

Le formulaire
<table valign="top">
	<tr>
<td valign="top"><img src="images/crea.png" alt=""></td>
<td valign="top">
<?
require("admin/ad_conf.inc.php");


if (!empty($_POST['mail']) AND !empty($_POST['titre']) AND !empty($_POST['theme']) AND !empty($_POST['couleur']) AND !empty($_POST['police']) AND !empty($_POST['img1']) AND !empty($_POST['img2']) AND !empty($_POST['img3']) AND !empty($_POST['img4']) AND !empty($_POST['admin']) AND !empty($_POST['description'])) // Si les variables existent
{
    if ($_POST['mail'] != NULL AND $_POST['titre'] != NULL AND $_POST['theme'] != NULL AND $_POST['couleur'] != NULL AND $_POST['police'] != NULL AND $_POST['img1']  != NULL AND $_POST['img2']  != NULL AND $_POST['img3']  != NULL AND $_POST['img4']  != NULL AND $_POST['admin']  != NULL AND $_POST['description'] != NULL) // Si on a quelque chose à enregistrer
    {
        mysql_connect("$host", "$user", "$mdp");
        mysql_select_db("$user");     
        
        $mail = htmlentities ($_POST['mail']);
        $titre = htmlentities ($_POST['titre']);
        $theme = htmlentities ($_POST['theme']);
        $couleur = htmlentities ($_POST['couleur']);
        $police = htmlentities ($_POST['police']);
        $img1 = htmlentities ($_POST['img1']);
        $img2 = htmlentities ($_POST['img2']);
        $img3 = htmlentities ($_POST['img3']);
        $img4 = htmlentities ($_POST['img4']);
        $admin = htmlentities ($_POST['admin']);
        $description = htmlentities ($_POST['description']);
         
        mysql_query("INSERT INTO kit VALUES('', '$mail', '$titre', '$theme', '$couleur', '$police', '$img1', '$img2', '$img3', '$img4', '$admin', '$description')");
        mysql_close();
        }
}
?>

<small>(*)<i>Réponce obligatoire !!!</i></small><br>
<form method="POST" action="v_kit.php">
*Mail:<br>
<input type="TEXT" size="50" name ="mail">
<br><br>
*Titre du site:<br>
<input type="TEXT" size="50" name ="titre">
<br><br>
*Thème(s):<br>
<input type="TEXT" size="50" name ="theme">
<br><br>
*Couleur(s):<br>
<input type="TEXT" size="50" name ="couleur">
<br><br>
Police:<br>
<input type="TEXT" size="50" name ="police">
<br><br>
Image(s):<br>
1. <input type="TEXT" size="50" name ="img1">
<br>
2. <input type="TEXT" size="50" name ="img2">
<br>
3. <input type="TEXT" size="50" name ="img3">
<br>
4. <input type="TEXT" size="50" name ="img4">
<br><br>
*Partie Admin:<br>
<input type="TEXT" size="50" name ="admin"> <small><i>Répondre par <b>OUI</b> ou <b>NON</b>.</i></small>
<br><br>
Description:<br>
<textarea name="description" rows="8" cols="35"></textarea>
<br><br><br>
<input type="SUBMIT" value="OK"></form>
<br><br>
<small><i>La partie administration comprend, un système de statisque, de création de menu, de création de lien partenaire, un système d'article.</i>
</td>
	</tr>
</table>

Le fichier de résultat :
<?
require("admin/ad_conf.inc.php");


        mysql_connect("$host", "$user", "$mdp");
        mysql_select_db("$user"); 


$retour = mysql_query('SELECT * FROM kit ORDER BY id DESC');
while ($donnees = mysql_fetch_array($retour))
{
?>
Votre mail : <font color="#009900"><? echo $donnees['mail']; ?><br></font>
Le titre de votre site : <font color="#009900"><? echo $donnees['titre']; ?><br></font>
Le(s) thème(s) : <font color="#009900"><? echo $donnees['theme']; ?><br></font>
La/Le(s) couleur(s) : <font color="#009900"><? echo $donnees['couleur']; ?><br></font>La police : <font color="#009900"><? echo $donnees['police']; ?><br></font>
Image(s):<br>
1.<? echo $donnees['img1']; ?><br>
2.<? echo $donnees['img2']; ?><br>
3.<? echo $donnees['img3']; ?><br>
4.<? echo $donnees['img4']; ?><br>
Partie Admin : <font color="#009900"><? echo $donnees['admin']; ?><br></font>
Description : <font color="#009900"><? echo $donnees['description']; ?><br></font>

<?
}
// Fin de la boucle, le script est terminé !
?>

par charabia » 06 sept. 2006, 16:26

On a maintenant la structure finale. Montres nous ton code d'insertion pour finir. On va pouvoir trouver ton souci.

par Tachikoma » 06 sept. 2006, 16:17

-- 
-- Structure de la table `kit`
-- 

CREATE TABLE `kit` (
  `id` int(11) NOT NULL auto_increment,
  `titre` varchar(255) collate latin1_general_ci NOT NULL default '',
  `mail` varchar(255) collate latin1_general_ci NOT NULL default '',
  `theme` text collate latin1_general_ci NOT NULL,
  `couleur` text collate latin1_general_ci NOT NULL,
  `police` text collate latin1_general_ci NOT NULL,
  `img1` text collate latin1_general_ci NOT NULL,
  `img2` text collate latin1_general_ci NOT NULL,
  `img3` text collate latin1_general_ci NOT NULL,
  `img4` text collate latin1_general_ci NOT NULL,
  `admin` text collate latin1_general_ci NOT NULL,
  `description` text collate latin1_general_ci NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ;

-- 
-- Contenu de la table `kit` 
ca ne marche toujours pas :?:

par charabia » 03 sept. 2006, 16:47

Heu...heu...je ne vois toujours pas le champ "mail"...La structure de la table n'a pas du tout changé.

par Tachikoma » 03 sept. 2006, 15:49

Oui j'ai bien tout remi

voila la table sorti direct de mysql:

Code : Tout sélectionner

-- phpMyAdmin SQL Dump -- version 2.6.3-pl1 -- http://www.phpmyadmin.net -- -- Serveur: br.team.sql.free.fr -- Généré le : Dimanche 03 Septembre 2006 à 15:48 -- Version du serveur: 5.0.25 -- Version de PHP: 4.4.4 -- -- Base de données: `br_team` -- -- -------------------------------------------------------- -- -- Structure de la table `kit` -- CREATE TABLE `kit` ( `id` int(11) NOT NULL auto_increment, `titre` varchar(255) collate latin1_general_ci NOT NULL default '', `theme` text collate latin1_general_ci NOT NULL, `couleur` text collate latin1_general_ci NOT NULL, `police` text collate latin1_general_ci NOT NULL, `img1` text collate latin1_general_ci NOT NULL, `img2` text collate latin1_general_ci NOT NULL, `img3` text collate latin1_general_ci NOT NULL, `img4` text collate latin1_general_ci NOT NULL, `admin` text collate latin1_general_ci NOT NULL, `description` text collate latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=1 ; -- -- Contenu de la table `kit`

par charabia » 03 sept. 2006, 11:08

Qu'as tu fais comme modif ?

Tu as bien rajouté dans ta table le champ mail et rajouté le champ couleur dans la ligne d'insertion ?
('', '$mail', '$titre', '$theme', '$couleur', '$police', '$img1', '$img2', '$img3', '$img4', '$admin', '$description')");

par Tachikoma » 03 sept. 2006, 11:05

cela ne marche toujours pas.
Il n'y a rien dans la BDD :s

par Invité » 03 sept. 2006, 10:48

Tu a oublier le champ mail dans ta table ?
et le champ police correspond à quoi ?
voi c'est rectifié je vais voir si sa marche :)

par dunbar » 02 sept. 2006, 22:24

('', '$mail', '$titre', '$theme', '$couleur', '$img1', '$img2', '$img3', '$img4', '$admin', '$description',)"); 
CREATE TABLE `kit` (
`id` int(11) NOT NULL auto_increment,
`mail` varchar(255) NOT NULL default '', <---- :!:
`titre` varchar(255) NOT NULL default '',
`theme` text NOT NULL default '',
`couleur` text NOT NULL default '',
`police` text NOT NULL default '', <------ :?:
`img1` text NOT NULL default '',
`img2` text NOT NULL default '',
`img3` text NOT NULL default '',
`img4` text NOT NULL default '',
`admin` text NOT NULL default '',
`description` text NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
j'ai éffectivement vérifié la BDD SQL est vide alors que les table est bonne
Tu a oublier le champ mail dans ta table ?
et le champ police correspond à quoi ?

par Invité » 02 sept. 2006, 22:04

j'ai éffectivement vérifié la BDD SQL est vide alors que les table est bonne :cry:

par charabia » 02 sept. 2006, 18:31

Le bug provient d'où exactement ?

Le INSERT fonctionne bien et tu as toutes les données dans ta base ?

C'est donc juste la page d'affichage qui a un souci ?

par Tachikoma » 02 sept. 2006, 17:39

dsl javais pas vu ke jété pas loggué :)

par Invité » 02 sept. 2006, 14:46

sa na pas l'air de changer sans la virgule.
L'insertion en base se fait-elle correctement ?
c'est à dir ?

par charabia » 02 sept. 2006, 11:12

L'insertion en base se fait-elle correctement ?

Enlèves déjà la dernire virgule :
mysql_query("INSERT INTO kit VALUES('', '$mail', '$titre', '$theme', '$couleur', '$img1', '$img2', '$img3', '$img4', '$admin', '$description')");