IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Récupération de la moitié des variables php


Sujet :

Langage PHP

  1. #1
    Nouveau membre du Club
    Inscrit en
    Mars 2006
    Messages
    89
    Détails du profil
    Informations forums :
    Inscription : Mars 2006
    Messages : 89
    Points : 30
    Points
    30
    Par défaut Récupération de la moitié des variables php
    Bonjourà tous ,

    Avant tout, mes exuses car j'ai posté ce message a la suite de mon précédent sujet qui était résolu, désolé.

    j'ai un code qui me récupére dans la base les infos d'un véhicule, dans la foulée, ces infos sont envoyées dans un pdf qui s'affiche à l'écran.

    Mon probléme est le suivant, le pdf est bien généré, mais je récupére seulement les variables suivantes :

    'Bjour' => $stored_day,
    'Bmois' => $stored_month,
    'Bannee' => $stored_year,
    'D1' => $model,
    'E' => $vin,

    Je ne récupére rien d'autre...
    Voci mon code :
    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
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    <?php
     
     
    include('../../include/ErrorHandler/error_handler.php');
    include('../../include/global.php');
    include('../include/auth.php');
    include('../../include/connection.php');
    include('../../include/functions.php');
    include('../../include/validation.php');
     
    if(!isset($HTTP_GET_VARS["id"]) || $HTTP_GET_VARS["id"]=="")
            die(header('location: index.php'));
     
     
    $error_msg = "";
    $msg = "";
    if($HTTP_SERVER_VARS['REQUEST_METHOD']=="POST") 
    {
    	/**** SERVER VALIDATION ****/
    	if(!(chk($HTTP_POST_VARS['year'],"IsNotEmpty,IsNumber")))
    	    $error_msg.= "- Please enter a Year<br>";
    	if(!(chk($HTTP_POST_VARS['model'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Make<br>";
    	if(!(chk($HTTP_POST_VARS['type'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Model<br>";
    	if(!(chk($HTTP_POST_VARS['engine'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter an Engine<br>";
    	if(!(chk($HTTP_POST_VARS['trans'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Trans<br>";
    	if(!(chk($HTTP_POST_VARS['drive'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Drive<br>";
    	if(!(chk($HTTP_POST_VARS['color'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Color<br>";
    	if(!(chk($HTTP_POST_VARS['millage'],"IsNotEmpty,IsNumber")))
    	    $error_msg.= "- Please enter a valid numeric value for Mileage<br>";
    	if(!(chk($HTTP_POST_VARS['price'],"IsMoney")))
    	    $error_msg.= "- Please enter a valid money value for Price<br>";
    	/*
    	if(!(chk($HTTP_POST_VARS['low'],"IsMoney")))
    	    $error_msg.= "- Please enter a valid money value for Low Book<br>";
    	if(!(chk($HTTP_POST_VARS['high'],"IsMoney")))
    	    $error_msg.= "- Please enter a valid money value for High Book<br>";
    	*/
    	if(!(chk($HTTP_POST_VARS['certified'],"IsSelected")))
    		$error_msg.= "- Please select an option for Certified<br>";
     
    	if(isset($HTTP_POST_VARS['special']))
    		$special="Y";
    	else
    		$special="N";
    	if($error_msg == "") 
    	{
    		#############################################################################
    		#	IF MAGIC QUOTE IN PHP.INI IS SET OFF ADD SLASHES TO SUBMITED VARIABLES	#
    		#############################################################################
    		$sql = "UPDATE ".$db_prefix."cars SET
    					stored='".$HTTP_POST_VARS['stored_year']."-".$HTTP_POST_VARS['stored_month']."-".$HTTP_POST_VARS['stored_day']."',
    					year='".add_slashes($HTTP_POST_VARS['year'])."',
    					model='".add_slashes($HTTP_POST_VARS['model'])."',
    					type='".add_slashes($HTTP_POST_VARS['type'])."',
    					engine='".add_slashes($HTTP_POST_VARS['engine'])."',
    					trans='".add_slashes($HTTP_POST_VARS['trans'])."',
    					drive='".add_slashes($HTTP_POST_VARS['drive'])."',
    					color='".add_slashes($HTTP_POST_VARS['color'])."',
    					millage='".add_slashes($HTTP_POST_VARS['millage'])."',
    					vin='".add_slashes($HTTP_POST_VARS['vin'])."',
    					price='".add_slashes(strip_out($HTTP_POST_VARS['price']))."',
    					low='".add_slashes(strip_out($HTTP_POST_VARS['low']))."',
    					high='".add_slashes(strip_out($HTTP_POST_VARS['high']))."',
    					features='".add_slashes($HTTP_POST_VARS['features'])."',
    					comments='".add_slashes($HTTP_POST_VARS['comments'])."',
    					certified='".add_slashes($HTTP_POST_VARS['certified'])."',
    					special= '".$special."',
    					datedevente='".$HTTP_POST_VARS['datedevente_year']."-".$HTTP_POST_VARS['datedevente_month']."-".$HTTP_POST_VARS['datedevente_day']."',
    					immatriculation='".add_slashes($HTTP_POST_VARS['immatriculation'])."',
                        typeduvehicule='".add_slashes($HTTP_POST_VARS['typeduvehicule'])."',
                        genre='".add_slashes($HTTP_POST_VARS['genre'])."',
                        carrosserie='".add_slashes($HTTP_POST_VARS['carrosserie'])."',
                        cv='".add_slashes($HTTP_POST_VARS['cv'])."',
                        kms_certifies='".add_slashes($HTTP_POST_VARS['kms_certifies'])."',
                        nom_acheteur='".add_slashes($HTTP_POST_VARS['nom_acheteur'])."',
                        adresse_acheteur='".add_slashes($HTTP_POST_VARS['adresse_acheteur'])."',
                        cp_acheteur='".add_slashes($HTTP_POST_VARS['cp_acheteur'])."',
                        ville_acheteur='".add_slashes($HTTP_POST_VARS['ville_acheteur'])."'
    				WHERE id=".$HTTP_GET_VARS["id"];
     
    		if(@mysql_query($sql))
    			die(header("Location: index.php?status=update"));
    		else
    			$error_msg = "Record was not updated because of invalid data posted.<br>- Stock must be unique.";
    	}
    	else//if($error_msg == "")
    		$error_msg = "Record was not updated because of invalid data posted.<br>".$error_msg;
     
    	$member_id = $HTTP_POST_VARS["member_id"];
    	$stock = $HTTP_POST_VARS["stock"];
    	$stored_month = $HTTP_POST_VARS["stored_month"];
    	$stored_day = $HTTP_POST_VARS["stored_day"];
    	$stored_year = $HTTP_POST_VARS["stored_year"];
    	$year = $HTTP_POST_VARS["year"];
    	$model = $HTTP_POST_VARS["model"];
    	$type = $HTTP_POST_VARS["type"];
    	$engine = $HTTP_POST_VARS["engine"];
    	$trans = $HTTP_POST_VARS["trans"];
    	$drive = $HTTP_POST_VARS["drive"];
    	$color = $HTTP_POST_VARS["color"];
    	$millage = $HTTP_POST_VARS["millage"];
    	$vin = $HTTP_POST_VARS["vin"];
    	$price = $HTTP_POST_VARS["price"];
    	$low = $HTTP_POST_VARS["low"];
    	$high = $HTTP_POST_VARS["high"];
    	$features = $HTTP_POST_VARS["features"];
    	$comments = $HTTP_POST_VARS["comments"];
    	$certified = $HTTP_POST_VARS["certified"];	
    	$datedevente_month = $HTTP_POST_VARS["datedevente_month"];
        $datedevente_day = $HTTP_POST_VARS["datedevente_day"];
        $datedevente_year = $HTTP_POST_VARS["datedevente_year"];
    	$immatriculation = $HTTP_POST_VARS["immatriculation"];
       $typeduvehicule = $HTTP_POST_VARS["typeduvehicule"];
       $genre = $HTTP_POST_VARS["genre"];
       $carrosserie = $HTTP_POST_VARS["carrosserie"];
       $cv = $HTTP_POST_VARS["cv"];
       $kms_certifies = $HTTP_POST_VARS["kms_certifies"];
       $nom_acheteur = $HTTP_POST_VARS["nom_acheteur "];
       $adresse_acheteur = $HTTP_POST_VARS["adresse_acheteur "];
       $cp_acheteur = $HTTP_POST_VARS["cp_acheteur"];
       $ville_acheteur = $HTTP_POST_VARS["ville_acheteur"];
       }
    else
    {
    	$sql = "SELECT * FROM ".$db_prefix."cars 
    	        WHERE id=".$HTTP_GET_VARS["id"]." 
    			AND member_id=".$HTTP_SESSION_VARS['ses_mem_id'];
     
    	$rs = @mysql_query($sql) or trigger_error('Error on executing '.$sql, E_USER_ERROR);
     
    	if(mysql_num_rows($rs)==0)
    	  die(header("location: index.php"));
    	list($id,
             $member_id,
             $stock,
    	     $stored,
    		  $year,
    		 $model,
    		 $type,
    		 $engine,
    		 $trans,
    		 $drive,
    		 $color,
    		 $millage,
    		 $vin,
    		 $price,
    		 $low,
    		 $high,
    		 $features,
    		 $comments,
    		 $certified,
    		 $special) = mysql_fetch_array($rs);
    		 list($stored_year,$stored_month,$stored_day) = explode("-",$stored);
    		 list($datedevente_year,$datedevente_month,$datedevente_day) = explode("-",$datedevente);
    		 $typeduvehicule;
    	     $genre;
    		 $carrosserie;
    		 $cv;
    		 $kms_certifies;
    	     $nom_acheteur ;
    		 $adresse_acheteur ;
    		 $cp_acheteur;
    		 $ville_acheteur ;			 
     
    }
    // adresse ou se trouve le fichier pdf
    $form = 'http://www.doublet-automobiles.com/search/cession.pdf';
     
    function create_fdf ($pdffile, $strings, $keys)
    {
       $fdf = "%FDF-1.2\n%????\n";
       $fdf .= "1 0 obj \n<< /FDF << /Fields [\n";
     
       foreach ($strings as $key => $value)
       {
           $key = addcslashes($key, "\n\r\t\\()");
           $value = addcslashes($value, "\n\r\t\\()");
           $fdf .= "<< /T ($key) /V ($value) >> \n";
       }
       foreach ($keys as $key => $value)
       {
           $key = addcslashes($key, "\n\r\t\\()");
           $fdf .= "<< /T ($key) /V /$value >> \n";
       }
     
       $fdf .= "]\n/F ($pdffile) >>";
       $fdf .= ">>\nendobj\ntrailer\n<<\n";
       $fdf .= "/Root 1 0 R \n\n>>\n";
       $fdf .= "%%EOF";
     
       return $fdf;
    }
     
    // listage  
    $strings = array(
       'nom1' => 'DOUBLET AUTOMOBILES',
       'nom2' => '',
       'adresse' => 'ZA LE PRE DROUE',
       'codepostal' => '88150',
       'ville' => 'CHAVELOT',
       'Bjour' => $stored_day,
       'Bmois' => $stored_month,
       'Bannee' => $stored_year,
       'D1' => $model,
       'E' => $vin,
       'numeroimmatriculation' => $immatriculation,
       'D2' => $typeduvehicule,
       'J1' => $genre,
        'J3' => $carrosserie,
        'P6' => $cv,
    	'anomprénom' => $nom_acheteur,
       'adresse1' => $adresse_acheteur,
       'codepostal1' => $cp_acheteur,
       'ville1' => $ville_acheteur,
        'lieu' => 'CHAVELOT',
       'date' => '16/06/2006'
         );
     
    // listage des  cases a cocher / boutons radios
    $keys = array('
       gender' => 'male',// bouton radio
       'transformation' => 'on',// case a cocher 
       'vendu' => 'on',// case a cocher 
       'urgent' => 'On'// case a cocher 
       );
     
    // Output  du formulaire
    header('Content-type: application/vnd.fdf');
    echo create_fdf($form, $strings, $keys);
     
    ?>
    Merci de votre aide...

  2. #2
    Expert éminent
    Avatar de berceker united
    Profil pro
    SQL
    Inscrit en
    Février 2005
    Messages
    3 488
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : SQL
    Secteur : Finance

    Informations forums :
    Inscription : Février 2005
    Messages : 3 488
    Points : 6 037
    Points
    6 037
    Par défaut
    Le code est assez gros donc je pourrais t'aider à trouver la réponse juste. Dans ces cas là il est préférable de faire un débugage pas à pas. Utilise la fonction print_r($_POST) ou get ou autre variable. Elle va te retourner le contu et la structure de ta variable. Ainsi tu peux voir là ou ça bloque.
    Utilise la fonction exit pour stopé le script.
    Ainsi tu peux faire un petit débug pas à pas.
    Controle ce qui rentre dans le script, ce qui rentre dans la fonction, le resultat attendu ...
    Mon avatar ? Ce n'est rien, c'est juste la tête que je fais lorsque je vois un code complètement frappa dingue !...

  3. #3
    Nouveau membre du Club
    Inscrit en
    Mars 2006
    Messages
    89
    Détails du profil
    Informations forums :
    Inscription : Mars 2006
    Messages : 89
    Points : 30
    Points
    30
    Par défaut
    Salut,

    quand j'utilise echo print_r($_GET); j'obtiens

    Array
    (
    [id] => 33
    )
    1

    avec post :

    Array
    (
    )
    1

    Je comprends que dalle...

    Quand on commence, c'est bonjour l'angoisse...



    L'aurais-je placé correctemment ?

    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
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    <?php
     
     
    include('../../include/ErrorHandler/error_handler.php');
    include('../../include/global.php');
    include('../include/auth.php');
    include('../../include/connection.php');
    include('../../include/functions.php');
    include('../../include/validation.php');
     
    if(!isset($HTTP_GET_VARS["id"]) || $HTTP_GET_VARS["id"]=="")
            die(header('location: index.php'));
     
     
    $error_msg = "";
    $msg = "";
    if($HTTP_SERVER_VARS['REQUEST_METHOD']=="POST") 
    {
    	/**** SERVER VALIDATION ****/
    	if(!(chk($HTTP_POST_VARS['year'],"IsNotEmpty,IsNumber")))
    	    $error_msg.= "- Please enter a Year<br>";
    	if(!(chk($HTTP_POST_VARS['model'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Make<br>";
    	if(!(chk($HTTP_POST_VARS['type'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Model<br>";
    	if(!(chk($HTTP_POST_VARS['engine'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter an Engine<br>";
    	if(!(chk($HTTP_POST_VARS['trans'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Trans<br>";
    	if(!(chk($HTTP_POST_VARS['drive'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Drive<br>";
    	if(!(chk($HTTP_POST_VARS['color'],"IsNotEmpty")))
    	    $error_msg.= "- Please enter a Color<br>";
    	if(!(chk($HTTP_POST_VARS['millage'],"IsNotEmpty,IsNumber")))
    	    $error_msg.= "- Please enter a valid numeric value for Mileage<br>";
    	if(!(chk($HTTP_POST_VARS['price'],"IsMoney")))
    	    $error_msg.= "- Please enter a valid money value for Price<br>";
    	/*
    	if(!(chk($HTTP_POST_VARS['low'],"IsMoney")))
    	    $error_msg.= "- Please enter a valid money value for Low Book<br>";
    	if(!(chk($HTTP_POST_VARS['high'],"IsMoney")))
    	    $error_msg.= "- Please enter a valid money value for High Book<br>";
    	*/
    	if(!(chk($HTTP_POST_VARS['certified'],"IsSelected")))
    		$error_msg.= "- Please select an option for Certified<br>";
     
    	if(isset($HTTP_POST_VARS['special']))
    		$special="Y";
    	else
    		$special="N";
    	if($error_msg == "") 
    	{
    		#############################################################################
    		#	IF MAGIC QUOTE IN PHP.INI IS SET OFF ADD SLASHES TO SUBMITED VARIABLES	#
    		#############################################################################
    		$sql = "UPDATE ".$db_prefix."cars SET
    					stored='".$HTTP_POST_VARS['stored_year']."-".$HTTP_POST_VARS['stored_month']."-".$HTTP_POST_VARS['stored_day']."',
    					year='".add_slashes($HTTP_POST_VARS['year'])."',
    					model='".add_slashes($HTTP_POST_VARS['model'])."',
    					type='".add_slashes($HTTP_POST_VARS['type'])."',
    					engine='".add_slashes($HTTP_POST_VARS['engine'])."',
    					trans='".add_slashes($HTTP_POST_VARS['trans'])."',
    					drive='".add_slashes($HTTP_POST_VARS['drive'])."',
    					color='".add_slashes($HTTP_POST_VARS['color'])."',
    					millage='".add_slashes($HTTP_POST_VARS['millage'])."',
    					vin='".add_slashes($HTTP_POST_VARS['vin'])."',
    					price='".add_slashes(strip_out($HTTP_POST_VARS['price']))."',
    					low='".add_slashes(strip_out($HTTP_POST_VARS['low']))."',
    					high='".add_slashes(strip_out($HTTP_POST_VARS['high']))."',
    					features='".add_slashes($HTTP_POST_VARS['features'])."',
    					comments='".add_slashes($HTTP_POST_VARS['comments'])."',
    					certified='".add_slashes($HTTP_POST_VARS['certified'])."',
    					special= '".$special."',
    					datedevente='".$HTTP_POST_VARS['datedevente_year']."-".$HTTP_POST_VARS['datedevente_month']."-".$HTTP_POST_VARS['datedevente_day']."',
    					immatriculation='".add_slashes($HTTP_POST_VARS['immatriculation'])."',
                        typeduvehicule='".add_slashes($HTTP_POST_VARS['typeduvehicule'])."',
                        genre='".add_slashes($HTTP_POST_VARS['genre'])."',
                        carrosserie='".add_slashes($HTTP_POST_VARS['carrosserie'])."',
                        cv='".add_slashes($HTTP_POST_VARS['cv'])."',
                        kms_certifies='".add_slashes($HTTP_POST_VARS['kms_certifies'])."',
                        nom_acheteur='".add_slashes($HTTP_POST_VARS['nom_acheteur'])."',
                        adresse_acheteur='".add_slashes($HTTP_POST_VARS['adresse_acheteur'])."',
                        cp_acheteur='".add_slashes($HTTP_POST_VARS['cp_acheteur'])."',
                        ville_acheteur='".add_slashes($HTTP_POST_VARS['ville_acheteur'])."'
    				WHERE id=".$HTTP_GET_VARS["id"];
     
    		if(@mysql_query($sql))
    			die(header("Location: index.php?status=update"));
    		else
    			$error_msg = "Record was not updated because of invalid data posted.<br>- Stock must be unique.";
    	}
    	else//if($error_msg == "")
    		$error_msg = "Record was not updated because of invalid data posted.<br>".$error_msg;
     
    	$member_id = $HTTP_POST_VARS["member_id"];
    	$stock = $HTTP_POST_VARS["stock"];
    	$stored_year = $HTTP_POST_VARS["stored_year"];
    	$stored_month = $HTTP_POST_VARS["stored_month"];
    	$stored_day = $HTTP_POST_VARS["stored_day"];
    	$year = $HTTP_POST_VARS["year"];
    	$model = $HTTP_POST_VARS["model"];
    	$type = $HTTP_POST_VARS["type"];
    	$engine = $HTTP_POST_VARS["engine"];
    	$trans = $HTTP_POST_VARS["trans"];
    	$drive = $HTTP_POST_VARS["drive"];
    	$color = $HTTP_POST_VARS["color"];
    	$millage = $HTTP_POST_VARS["millage"];
    	$vin = $HTTP_POST_VARS["vin"];
    	$price = $HTTP_POST_VARS["price"];
    	$low = $HTTP_POST_VARS["low"];
    	$high = $HTTP_POST_VARS["high"];
    	$features = $HTTP_POST_VARS["features"];
    	$comments = $HTTP_POST_VARS["comments"];
    	$certified = $HTTP_POST_VARS["certified"];	
        $datedevente_year = $HTTP_POST_VARS["datedevente_year"];
    	$datedevente_month = $HTTP_POST_VARS["datedevente_month"];
    	$datedevente_day = $HTTP_POST_VARS["datedevente_day"];
    	$immatriculation = $HTTP_POST_VARS["immatriculation"];
       $typeduvehicule = $HTTP_POST_VARS["typeduvehicule"];
       $genre = $HTTP_POST_VARS["genre"];
       $carrosserie = $HTTP_POST_VARS["carrosserie"];
       $cv = $HTTP_POST_VARS["cv"];
       $kms_certifies = $HTTP_POST_VARS["kms_certifies"];
       $nom_acheteur = $HTTP_POST_VARS["nom_acheteur "];
       $adresse_acheteur = $HTTP_POST_VARS["adresse_acheteur "];
       $cp_acheteur = $HTTP_POST_VARS["cp_acheteur"];
       $ville_acheteur = $HTTP_POST_VARS["ville_acheteur"];
       }
    else
    {
    	$sql = "SELECT * FROM ".$db_prefix."cars 
    	        WHERE id=".$HTTP_GET_VARS["id"]." 
    			AND member_id=".$HTTP_SESSION_VARS['ses_mem_id'];
     
    	$rs = @mysql_query($sql) or trigger_error('Error on executing '.$sql, E_USER_ERROR);
     
    	if(mysql_num_rows($rs)==0)
    	  die(header("location: index.php"));
    	list($id,
             $member_id,
             $stock,
    	     $stored,
    		 $year,
    		 $model,
    		 $type,
    		 $engine,
    		 $trans,
    		 $drive,
    		 $color,
    		 $millage,
    		 $vin,
    		 $price,
    		 $low,
    		 $high,
    		 $features,
    		 $comments,
    		 $certified,
    		 $special) = mysql_fetch_array($rs);
    		 list($stored_year,$stored_month,$stored_day) = explode("-",$stored);
    		 list($datedevente_year,$datedevente_month,$datedevente_day) = explode("-",$datedevente);
    		 $datedevente;
    		 $immatriculation;
    		 $typeduvehicule;
    	     $genre;
    		 $carrosserie;
    		 $cv;
    		 $kms_certifies;
    	     $nom_acheteur ;
    		 $adresse_acheteur ;
    		 $cp_acheteur;
    		 $ville_acheteur ;			 
     
    };
     
     
    echo "<pre>\n";
    echo print_r($_POST);
    echo "</pre>\n"; 
    ?>

  4. #4
    Expert éminent
    Avatar de berceker united
    Profil pro
    SQL
    Inscrit en
    Février 2005
    Messages
    3 488
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : SQL
    Secteur : Finance

    Informations forums :
    Inscription : Février 2005
    Messages : 3 488
    Points : 6 037
    Points
    6 037
    Par défaut
    Alors résumons la chose

    Lorsque tu postes ton formulaire, il peut être en method="post" ou method="get".
    Dans ton cas tu gères les deux car je vois qu'il y a une condition.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    if($HTTP_SERVER_VARS['REQUEST_METHOD']=="POST"){
    ...
    }else{
    ...
    }
    Dans le cas ou tu te trouve dans le poste tu fais.
    print_r($_POST). Ceci va te retourner le contenu des noms des valeurs issus de ton champs de formulaire. Avec ça tu peux controler.
    Avec le get il t'a retourné
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    Array
    (
    [id] => 33
    )
    C'est que dans ton champs de formulaire il y a un input ou select avec name="id" value="33"
    Mon avatar ? Ce n'est rien, c'est juste la tête que je fais lorsque je vois un code complètement frappa dingue !...

  5. #5
    Nouveau membre du Club
    Inscrit en
    Mars 2006
    Messages
    89
    Détails du profil
    Informations forums :
    Inscription : Mars 2006
    Messages : 89
    Points : 30
    Points
    30
    Par défaut appel depuis une page
    J'ai une page d'accueil avec un descriptif sommaire du vehicule, puis un lien

    <a href="cession_pdf.php?id=<? echo $row["id"];?>">test cession</a><br>

    id 33 etant l'identifiant du véhicule

  6. #6
    Expert éminent
    Avatar de berceker united
    Profil pro
    SQL
    Inscrit en
    Février 2005
    Messages
    3 488
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : SQL
    Secteur : Finance

    Informations forums :
    Inscription : Février 2005
    Messages : 3 488
    Points : 6 037
    Points
    6 037
    Par défaut
    ok effectivement ça vient pas d'un champs de formulaire mais d'un parametre passé au URL. C'est la même chose. En gros, le get signifie juste que les parametre sont passé dans l'url. blalbla.xx?toto=la_vache
    Mon avatar ? Ce n'est rien, c'est juste la tête que je fais lorsque je vois un code complètement frappa dingue !...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. récupération des variables php
    Par olfa_bl dans le forum Général JavaScript
    Réponses: 9
    Dernier message: 22/04/2012, 16h07
  2. Recuperer des variable PHP
    Par Extra-Nitro dans le forum Flash
    Réponses: 3
    Dernier message: 03/07/2006, 10h33
  3. [PHP-JS] Test des variables (PHP ou JavaScript) ??
    Par King_T dans le forum Langage
    Réponses: 5
    Dernier message: 23/05/2006, 12h19
  4. [MySQL] Php / Html Mettres des Variables PHP en Values sur des form
    Par Jimmy_S dans le forum PHP & Base de données
    Réponses: 6
    Dernier message: 22/03/2006, 11h18
  5. [Swishmax] Récupérer des variables php
    Par denis finch dans le forum Flash
    Réponses: 3
    Dernier message: 23/12/2005, 15h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo