juliacom
Messages postés11Date d'inscriptionmardi 13 mai 2003StatutMembreDernière intervention 7 novembre 2009
-
16 avril 2005 à 17:35
malalam
Messages postés10839Date d'inscriptionlundi 24 février 2003StatutMembreDernière intervention 2 mars 2010
-
18 avril 2005 à 04:39
voici ce qu il arrive :
Call to undefined function: affiche_formulaire_ajout_photos()
j ai ecrit ceci : switch ($mode) {
case "ajout" :
if (!isset($id)) { $id = 0; };
affiche_formulaire_ajout_photos();
break;
et la fonction: function affiche_formulaire_ajout_photos() {
global $PHP_SELF,$frm;
/* Affiche un formulaire vide */
/* Valeurs par défaut */
$frm["image_left"] = "";
$frm["image_right"] = "";
$frm["image_menu"] = "";
$frm["image_botton"] = "";
$frm["titre_soumet"] = "Ajouter";
affiche_formulaire_ajout_photos();
morceau de code html quice termine par:</table>
puis appelle de la fonction
<?
function affiche_formulaire_ajout_photo($id) {
GLOBAL $PHP_SELF, $frm;
/* Affiche un formulaire vide */
/* Valeurs par défaut */
$frm["image_left"] = "";
$frm["image_right"] = "";
$frm["image_menu"] = "";
$frm["image_botton"] = "";
$frm["titre_soumet"] = "Ajouter";
affiche_formulaire_photos ();
#include("modeles/photo_form.php");
}
function affiche_formulaire_modif_photo($id) {
/* Affiche le formulaire de modification de catégorie. */
GLOBAL $PHP_SELF, $frm ;
/* Charge les infos . */
$qid = mysql_query("
SELECT image_left, image_right, image_menu, image_botton
FROM photos
WHERE id = $id
");
$frm = mysql_fetch_array($qid);
$frm["nouveau_mode"] = "maj";
$frm["titre_soumet"] = "Sauvegarder changements";
mais j ai toujours ceci :Call to undefined function: affiche_formulaire_ajout_photos() idem pour modif
merci si idée ,si probleme je peux te faire parvenir mon script
Vu comment tu me presentes ton code, tu appelles ta fonction AVANT de la definir. Il faut que ta fonction soit definie avant de l'appeler, sinon php ne connait pas cette fonction.
exemple :
appelle_fonction ();
function appelle_fonction () {
echo 'appel de ma fonction';
}
ca, ca ne marchera pas. Mais :
function appelle_fonction () {
echo 'appel de ma fonction';
}