Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2453 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Appel de fonction pour un novice

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Appel de fonction pour un novice

n°1385920
titdav
Posté le 12-06-2006 à 17:01:10  profilanswer
 

Bonjour à tous, je commence à mettre le nez dans le php, un peut d'aide ne serait pas de refus.
 
Dans le fichier sidebar.php j'ai (entre autres) :
 
<h2 title="Météo à 10 jours"><a title="Meteo a 10 jours" href="http://fr.weather.com/weather/local/FRXX0294">Ma Meteo</a></h2><?php weathersb(''); ?>

 
Dans le fichier weather.php, j'ai (entre autres) :
 
function weathersb() {
$locid = get_option('weather_locid');
$parid = get_option('weather_parid');
$key = get_option('weather_key');
$ut = get_option('weather_unit');
$hum = get_option('weather_hum');
$wind = get_option('weather_wind');
$uv = get_option('weather_uv');
$icon = get_option('weather_icon');
$weather = new Weather($locid, $parid, $key);
 
if ($icon == 'y') { echo '<img src="wp-content/plugins/weather/'.addWeatherTerm($weather->Icon).'.png" alt="Weather Icon " align="left" />'.'<br /><br />'; }
echo $weather->Dnam . "<br />\n<span title=\"Temperature\">" . $weather->Temperature . "&deg;".$weather->UnitTemp."</span>";
if($hum == 'y') { echo '<li>Humidite : '. $weather->Humidity. '</li>'; }     #<span title="Humidity">  </span>
if($wind == 'y') { echo '<li>Vent : '. $weather->Wind . $weather->UnitSpeed .' '. $weather->Direction .'</li>'; }
if($uv == 'y') { echo '<li>Indice UV : '. $weather->UVIndex . ' ' . $weather->UVStatus .'</li><br />'; }

}  
 
locid contient FRXX0294. Je voudrai faire appel à la fonction weathersb() pour que FRXX0294 ne soit pas inscrit en dur dans le code.
 
Je suis sûr que la réponse tient en une ligne, aidez moi...
 
Merci d'avance.

mood
Publicité
Posté le 12-06-2006 à 17:01:10  profilanswer
 

n°1385925
zapan666
Tout est relatif
Posté le 12-06-2006 à 17:05:14  profilanswer
 

Code :
  1. <a title="Meteo a 10 jours" href="http://fr.weather.com/weather/local/<?php echo get_option('weather_locid'); ?>">


 
 
 
...


---------------
my flick r - Just Tab it !
n°1385930
titdav
Posté le 12-06-2006 à 17:12:11  profilanswer
 

zapan666 a écrit :

Code :
  1. <a title="Meteo a 10 jours" href="http://fr.weather.com/weather/local/<?php echo get_option('weather_locid'); ?>">


 
 
 
...


 
 
MERCI !  


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Appel de fonction pour un novice

 

Sujets relatifs
array_filter + transmission de variable dans une fonction callbackMysql -> Fonction IN (1,2,3) AND et pas OR
fonction Lookup plante GDB sous DDDfonction somme avec des variables
Fonction JS dans formulaire htmlFonction mail avec un if else tout bête et javascript confirm()
Probleme sous Excel (fonction index) urgentpb fonction str_replace
[JS] Créer une fonctionAppel d'une clé du registre
Plus de sujets relatifs à : Appel de fonction pour un novice


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR