Page 1 sur 2

L'installation en local sur ma machine BIG BIG SOUCI

Posté : 24 janv. 2012, 22:14
par mattsulivan
Bonjour,ou Bonsoir

Je vient vers vous à cause d'un Gros problème j'ai installer en local ( sur ma machine et Mon niveau en php est très débutant voir NUL)
mon site internet mais quand je veux le voir il me donne des TONNES des erreurs au secours pouvez-vous m'aides

voila ce que ca me dit : Notice: Undefined index: login in C:\xampp\htdocs\baby\vendre.php on line 3
Notice: Undefined index: login in C:\xampp\htdocs\baby\vendre.php on line 4
Notice: Undefined index: mdp in C:\xampp\htdocs\baby\vendre.php on line 5
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\baby\vendre.php on line 12
Notice: Undefined index: categ in C:\xampp\htdocs\baby\vendre.php on line 14
Notice: Undefined index: act in C:\xampp\htdocs\baby\vendre.php on line 15
Notice: Undefined index: id_user in C:\xampp\htdocs\baby\vendre.php on line 74


et ca aussi :
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\baby\menu.php on line 5
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\baby\menu.php on line 38
Notice: Undefined variable: Users in C:\xampp\htdocs\baby\menu.php on line 46
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\baby\menu.php on line 46


Que faire ? quelqu'un a une solution ?

UN BIG Merci d'avance

Christophe

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 24 janv. 2012, 22:20
par Aureusms
Belles erreurs en effet. Quel est la portion de code qui génère ce problème ?

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 24 janv. 2012, 22:29
par mattsulivan
Bonsoir

le souci c'est que je ne c'est pas je suis une gros brelle en PHP
comment je peut faire pour vous montrer une image de mon souci
Cdt
Christophe

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 24 janv. 2012, 22:37
par Aureusms
Copie colle le script

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 25 janv. 2012, 09:18
par mattsulivan
je le colle ou ?
Help
Cdt
Christophe

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 25 janv. 2012, 09:55
par xTG
Tu le colles sur ce forum dans ton message en l'entourant des balises [*php]ton code[/*php] (en enlevant les *).

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 26 janv. 2012, 11:43
par mattsulivan
Bonjour,

Un Grand merci a vous pour votre aide POUR MON BIG SOUCI

http://www.flickr.com/photos/75214051@N ... hotostream

Cdt
Christophe M

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 26 janv. 2012, 12:07
par moogli
ce que les gens demande c'est le code php (ce qu'il y a dans le fichier.php).

les premières erreur indique une validation de formulaire foireuse ? voir => http://www.phpdebutant.org/article56.php

ta dernière image indique que tu affiche ton code à un moment ou un autre.

le seul moyen de t'aider c'est le code source (ce que tu tape dans le fichier .php)

@+

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 26 janv. 2012, 12:21
par mattsulivan
Bonjour,
je n'ai pas de fichier.php ?
je comprend pas j'ai pas ce fichier
Cdt
Christophe M

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 26 janv. 2012, 12:26
par moogli
O_o
voila ce que ca me dit : Notice: Undefined index: login in C:\xampp\htdocs\baby\vendre.php on line 3Notice: Undefined index: login in C:\xampp\htdocs\baby\vendre.php on line 4Notice: Undefined index: mdp in C:\xampp\htdocs\baby\vendre.php on line 5Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\baby\vendre.php on line 12Notice: Undefined index: categ in C:\xampp\htdocs\baby\vendre.php on line 14Notice: Undefined index: act in C:\xampp\htdocs\baby\vendre.php on line 15Notice: Undefined index: id_user in C:\xampp\htdocs\baby\vendre.php on line 74 et ca aussi :Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\baby\menu.php on line 5Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\baby\menu.php on line 38Notice: Undefined variable: Users in C:\xampp\htdocs\baby\menu.php on line 46Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\baby\menu.php on line 46
si la y a pas de php j'y connais quedal !

la pour le coup je pense que est préférable de commencer le tuto zéro de phpdebutant (c'est pas péjoratif c'est juste qu'il faut commencer par quelque chose, de plus en info la numérotation commence toujours à zéro ;) )

@+

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 26 janv. 2012, 12:38
par xTG
Bonjour,
je n'ai pas de fichier.php ?
je comprend pas j'ai pas ce fichier
Cdt
Christophe M
Que tu ais du mal à comprendre le PHP passe encore...
Mais que tu ne saches pas réfléchir par toi même est une aberration.

On te demande le code depuis le début du topic. Quand on te demande un fichier .php ce n'est pas le fichier nommé fichier.php mais bel et bien le fichier php concerné.
A savoir dans ton cas vendre.php d'après le message d'erreur.

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 26 janv. 2012, 12:54
par mattsulivan
Bonjour,
ok ok je suis desoler je suis NUL mais bon je vient vous voir pour de l'aide
je vous joint le vendre.php :
Cdt
Christophe M
PS/ UN GRAND MERCI POUR VOTRE PACIENCE


<?
session_start();
$seslog=$_SESSION['login'];
$log=$_POST['login'];
$mdp=$_POST['mdp'];
$mdp5=md5($mdp);
include "mysql.php";
$time=time();
$sqlquery="SELECT COUNT(id_user) FROM connecte WHERE date>'".date('Y-m-d H:i:s',$time-60*10)."'";
$result=mysql_query($sqlquery);

list($nbr_connectes)=mysql_fetch_row($result);

$categ=$_GET['categ'];
$act=$_GET['act'];
?><!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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><meta name="description" content="Annonces de garde d'enfant : baby sitter, nourrice, assistante maternelle, garde partagée, au pair, puériculture.">
<meta name="keywords" lang="fr" content="bebe,nounou,b&eacute;b&eacute;,nourrice,baby-sitter,garde d'enfant,babysitter,baby-sitting,annonce,nurse,bebes,baby,garde,b&eacute;b&eacute;s,gardien,nounous,gardienne,nourrices,baby-sitters,babysitters,gouvernante,babysitting,annonces,assistante,maternelle,bebe,petite annonce,pair,assistante maternelle,gardes,enfant,aide,cherche,garde partag&eacute;e,conseil,nourrice agr&eacute;&eacute;e,baby,bebes,conseils,enfants,bambin,recherche,emploi,agr&eacute;&eacute;e,sitter,gardes partag&eacute;es,bambins,partagee,agr&eacute;&eacute;,sitters,sitting,partag&eacute;e,emplois,agreee,partag&eacute;es,fille,partagees,filles,garcon,papa,maman,garcons,papas,mamans,parents,Paris,Marseille,Lyon,Bordeaux,Toulouse,Lille,Strasbourg,province,parisienne,soir,&eacute;cole,vacance,domicile,soir&eacute;e,pair,ecole,vacances,au pair,scolaire,soiree,au-pair,soir&eacute;es,&eacute;coles,scolaires,soirees,ecoles,sortie d'&eacute;cole,vacances scolaires,sorties d'&eacute;coles,employeur,nourice,agr&eacute;e,agree">
<meta name="keywords" lang="en" content="baby,babies,nanny,nannies,babysitter,babysitters,nurse,child,children,nany,nanies">
<meta name="classification" content="bebe,annonce,nounou,nourrice,baby-sitter,baby,sitter,sitting,pair,gardien,enfant,papa,maman,parent,emploi,garde,petites annonces,aide,conseil">

<title>Les-encheres-bebe.com </title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #666666;
}
body {
margin-left: 0px;
margin-top: 8px;
margin-right: 0px;
margin-bottom: 15px;
BACKGROUND: url(images/bg.jpg) #FFFFFF no-repeat; background-position: top center;
background-attachment: fixed;
}
a:link {
color: #CC0066;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #CC0066;
}
a:hover {
text-decoration: underline;
color: #0099FF;
}
a:active {
text-decoration: none;
color: #000000;
}
.Style1 {font-size: 10px}
.Style2 {padding:4px}
.Style3 {color: #FF0000}
.plop{ margin-left:-25px}
-->
</style><script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-11789208-1");
pageTracker._trackPageview();
} catch(err) {}</script></head>

<body>
<table width="900" style="border : 1px solid #FFFFFF" align="center" cellpadding="0" cellspacing="2">
<tr>
<td colspan="2" align="right" style="padding-bottom: 5px;"><?php if(!$_SESSION['id_user']) echo '<a href="connexion.php">S\'identifier</a> | <a href="inscrire.php">Créer un compte</a> | '; else echo '<a href="index.php?act=dec">Déconnexion</a> | '; ?><?php echo number_format($nbr_connectes,0,',','.'); ?> <a href="membres_enligne.php">membre<?php echo ($nbr_connectes > 1)?"s":""; ?> en ligne</a></td>
</tr>
<tr>
<td colspan="2"><img src="images/ban.jpg" width="900" height="270" border="0" usemap="#Map" />
<map name="Map" id="Map">
<area shape="rect" coords="717,222,795,250" href="contact.php" />
<area shape="rect" coords="567,207,681,246" href="faq.php" />
<area shape="rect" coords="431,213,536,245" href="compte.php" />
<area shape="rect" coords="332,210,406,239" href="vendre.php" />
<area shape="rect" coords="208,214,308,254" href="inscrire.php" />
<area shape="rect" coords="110,205,181,241" href="index.php" />
</map>
</td>
</tr>
<tr>
<td colspan="2" background="images/fond2.jpg"><img src="images/titre.jpg" width="900" height="50" /></td>
</tr>
<tr>
<td width="220" valign="top" background="images/fond2.jpg">
<div align="left"><img src="images/cat_menu.jpg" alt="Les cat&eacute;gories des ench&egrave;res" /><br />
<?
include "menu.php";
?>
</div></td>
<td width="677" valign="top" bgcolor="#FFFFFF" class="Style2"><p align="left"><?
if ($seslog!='')
{
if ($act=='ins')
{
$cat=$_POST['cat'];
$scat=$_POST['scat'];
$titre=$_POST['titre'];
$desc=$_POST['desc'];
$px=$_POST['px'];
$paiement=$_POST['paiement'];
$port=$_POST['port'];
$etat=$_POST['etat'];
$photo=$_POST['photo'];
$duree = $_POST['temps'];
$time=time();
$date=$time + ($duree * 24 * 60 * 60);
if (is_numeric($px))
{

}
else
{
$px='';
echo 'Le prix de lancement doit être un nombre, les centimes doivent être séparés par un point (.)<br>';
}
if ($cat!='0' && $titre!='' && $desc!='' && $px!='' && $paiement!='' && $port!='' && $etat!='')
{
$verif="insert into ench values ('', '$cat', '$scat', '$titre', '$desc', '$px', '$paiement', '$port', '$etat', '$seslog', '$date','actif')";
$resverif=mysql_query($verif);

$verif="select * from ench where user_ench='$seslog' order by id_ench desc limit 0,1";
$resverif=mysql_query($verif);
$num_result=mysql_num_rows($resverif);
$row=mysql_fetch_array($resverif);
$num=stripslashes($row['id_ench']);
$content_dir = 'photo/';
$tmp_file = $_FILES['photo']['tmp_name'];
$type_file = $_FILES['photo']['type'];
$name_file = $_FILES['photo']['name'];
$taille=$_FILES['photo']['size'];
$name_file=strtolower($name_file);
$t=explode('.',$name_file);
$num=$num.'.jpg';
if ($_FILES['photo']['name']!='')
{
if ($t[1]!='jpg' || $taille > 1024000)
{
copy ('photo/na.jpg','photo/'.$num);
}
else
{
move_uploaded_file($tmp_file, $content_dir . $num) or (copy ('photo/na.jpg','photo/'.$num));
}
}
else
{
copy ('photo/na.jpg','photo/'.$num);
}
echo 'Votre produit est mis en vente';
}
else
{
echo "Un des champs n'etait pas rempli ou incorect.<br> <strong>Votre annonce est remise à zero ...</strong>";
include "form3.php";
}
}
else
{
include "form3.php";
}
}
else
{
echo "Il faut être inscrit pour acceder à cette page";
}
?></p> </td>
</tr>
<tr>
<td height="60" colspan="2" background="images/foot.jpg"><div align="center"><?
include "pied.html";
?></div></td>
</tr>
</tr>
</table>
</body>
</html>

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 26 janv. 2012, 13:10
par xTG
Beaucoup à reprendre dans ce script.
Les erreurs ne sont pas gérées... A mon avis celui qui l'a conçu travaillait sur un serveur n'affichant pas les erreurs et ne s'en est donc pas soucié...

Remplaces les <? par <?php déjà.

Ensuite pour les variables qui n'existent pas ($_POST, $_SESSION, $_GET) voilà comment corriger (exemple avec une variable de $_POST):
$laVariable = (isSet($_POST['variable']))? $_POST['variable'] : null;
Car actuellement le script affectes directement des variables et ce sans vérifier qu'elles existent. Cette modification ferra en sorte que si la variable n'existe pas on affecte la valeur null à la place.

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 26 janv. 2012, 17:01
par mattsulivan
Bonjour,

je comprend RIEN pouvez vous SVP me guider je mais les images de tous mais souci

http://www.flickr.com/photos/75214051@N ... otostream/

Cdt
Christophe

Re: L'installation en local sur ma machine BIG BIG SOUCI

Posté : 27 janv. 2012, 08:54
par Invité
Bonjour qui veux bien m'aide j'ai vraiment beaucoup de mala comprendre