Bonjour,
mon code ne s'execute pas sous wamp server avec la version 5.3.8 de php5:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
<?php
require_once("Entreprise.php");
include("connect.php");
ma_connection();
$nom=$_POST['t1'];
$secteur=$_POST['secteur'];
$nat=$_POST['t2'];
$siege=$_POST['t3'];
$tel=$_POST['t4'];
$email=$_POST['t5'];
$id=$_POST['t6'];
$pwd=$_POST['p1'];
$pwd2=$_POST['p2'];
$r="INSERT INTO entreprise VALUES ('','$nom','$secteur','$nat','$siege','$tel','$email','$id','$pwd')";
$res=mysql_query($r);
if($res){
$ent=new Entreprise($nom,$secteur,$nat,$siege,$tel,$email,$id,$pwd);
echo $ent->nom;}
else
echo "mysql_error()";
?>
****************************
et voila ma classe Entreprise

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
<?
class Entreprise
{
public $nom;
public $secteur;
public $nat;
public $siege;
public $tel;
public $email;
public $id;
public $pwd;
function Entreprise($nom,$secteur,$nat,$siege,$tel,$email,$id,$pwd)
{
$this->nom= $nom;
$this->secteur = $secteur;
$this->nat = $nat;
$this->siege = $siege;
$this->tel = $tel;
$this->email = $email;
$this->id = $id;
$this->pwd = $pwd;
}
}
?>
******************
il m'affiche ceci
****nom= $nom; $this->secteur = $secteur; $this->nat = $nat; $this->siege = $siege; $this->tel = $tel; $this->email = $email; $this->id = $id; $this->pwd = $pwd; } } ?>mysql_error()****