intégrer select dans une page php

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 : intégrer select dans une page php

Re: intégrer select dans une page php

par xTG » 25 mars 2012, 10:16

Voilà de quoi comprendre comment faire cela : http://phpdebutant.org/article56.php :)

intégrer select dans une page php

par kim75 » 25 mars 2012, 03:16

Bonsoir,

Pour ajouter la météo à mon blog, quelqu'un pourrait-il m'aider à intégrer une select liste dans une page php s'il vous plait !

code initial :
<?php
include('weather.class.php');
$zip = "FRXX0055";
define('DEFAULT_UNITS', "c");
define('IMAGES', 'icons/sm/');
if($zip != '')
{
	if (isset($_GET['units'])) {$s_unit_of_measure = strtolower($_GET['units']);}
	else {$s_unit_of_measure = DEFAULT_UNITS;}
	$weather = new Weather();
	$weather = $weather->getWeather($zip, $s_unit_of_measure);
}
?>
<!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">
<head>
<title>Test List Php</title>
</head>
<body>
<table>
  <tr>
    <td>Lyon</td>
  </tr>
</table>
</body>
</html>
modification prévue :
<?php
include('weather.class.php');
$zip = "ICI LA VALEUR DE L’ITEM DU SELECT";	
define('DEFAULT_UNITS', "c");
define('IMAGES', 'icons/sm/');
if($zip != '')
{
	if (isset($_GET['units'])) {$s_unit_of_measure = strtolower($_GET['units']);}
	else {$s_unit_of_measure = DEFAULT_UNITS;}
	$weather = new Weather();
	$weather = $weather->getWeather($zip, $s_unit_of_measure);
}
?>
<!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">
<head>
<title>Test List Php</title>
</head>
<body>
<table>
  <tr>
    <td>ICI LE NOM DE L’ITEM DU SELECT</td>
    <td>ICI LA LISTE SELECT</td>
  </tr>
</table>
</body>
</html>
la liste select :

Code : Tout sélectionner

<select id ="" class="" onchange =""> <option value="FRXX0055">Lyon</option> <option selected value="FRXX0076">Paris</option> <option value="FRXX0059">Marseille</option> <option value="FRXX0095">Strasbourg</option> </select>
Merci pour votre aide