Hello,
I am french so I don't speak English very well.
My problem : Since several days, the php code doesn't work in my form. I don't touch anything in the code so I don't know what to do.
I created an external page with the same code. This one works. On the other hand, the code php refuses to work on the page where is the chronoform form.
If you have encountered the same type of problem or have a suggestion, I will be grateful for sharing your ideas.
Thanks.
Audrey
I am french so I don't speak English very well.
My problem : Since several days, the php code doesn't work in my form. I don't touch anything in the code so I don't know what to do.
I created an external page with the same code. This one works. On the other hand, the code php refuses to work on the page where is the chronoform form.
If you have encountered the same type of problem or have a suggestion, I will be grateful for sharing your ideas.
Thanks.
Audrey
Hi Audrey,
The first link you posted doesn't work. I get this error "Vous n'êtes pas autorisé à accéder à cette partie du site."
PHP isn't visible from the browser so I have no idea what code isn't working :-(
The form appears to submit correctly.
Bob
The first link you posted doesn't work. I get this error "Vous n'êtes pas autorisé à accéder à cette partie du site."
PHP isn't visible from the browser so I have no idea what code isn't working :-(
The form appears to submit correctly.
Bob
Thank you for your reply.
This is a the wrong link, the good one is here http://www.ilereunion.com/resa.php?id_dormir=83
This is a the wrong link, the good one is here http://www.ilereunion.com/resa.php?id_dormir=83
Hi Audrey,
That does show me a form but I still have no idea what the problem is :-(
Bob
That does show me a form but I still have no idea what the problem is :-(
Bob
Difficult to explain my problem in a language which I do not master.
Even in French it is difficult to explain.
The problem :
The php code does not work. A simple "echo" in php shows nothing in the page which contains the chronoform form http://www.ilereunion.com/etablissement-details?id_dormir=83&type=2
While the php code works properly in an external page as http://www.ilereunion.com/resa.php?id_dormir=83. This page shows additional fields such as the client's email address which is indispensable for the sending of the form to the owner of the establishment.
Given that the php code does not work properly, only the customer receives a summary of his request by mail whereas the hotelkeeper, him, does not receive booking request.
I hope that my demand is clearer this time and my English not too disastrous.
Even in French it is difficult to explain.
The problem :
The php code does not work. A simple "echo" in php shows nothing in the page which contains the chronoform form http://www.ilereunion.com/etablissement-details?id_dormir=83&type=2
While the php code works properly in an external page as http://www.ilereunion.com/resa.php?id_dormir=83. This page shows additional fields such as the client's email address which is indispensable for the sending of the form to the owner of the establishment.
Given that the php code does not work properly, only the customer receives a summary of his request by mail whereas the hotelkeeper, him, does not receive booking request.
I hope that my demand is clearer this time and my English not too disastrous.
Hi Audrey,
Vous pouvez écrire en français si vous voulez.
How are you trying to add the PHP code in the ChronoForm? Are you using a Custom Element element from the Advanced group?
Bob
Vous pouvez écrire en français si vous voulez.
How are you trying to add the PHP code in the ChronoForm? Are you using a Custom Element element from the Advanced group?
Bob
Bonjour,
Bonne nouvelle pour le français, ça sera plus simple pour moi.
Le code php est simplement dans : Forms Managment > Form Code > Form HTML (May contain PHP code with tags).
Le code est très simple et fonctionnait très bien jusque là.
Voici un extrait :
Avant les champs était en type="hidden", je les ai mis en "text" pour voir si le code php s'exécutait. C'est à ce moment que je me suis rendu compte que non.
Je ne sais pas d'où vient le problème.
Ce pourrait-il, que ce soit un changement au niveau de mon hébergeur qui provoque ça?
Ce qui est étrange c'est que ce code fonctionne dans une page externe mais pas dans le formulaire de chronoform alors qu’il fonctionnait très bien jusque là.
Si vous avez des idées sur la marche à suivre je suis preneuse.
Audrey
Bonne nouvelle pour le français, ça sera plus simple pour moi.
Le code php est simplement dans : Forms Managment > Form Code > Form HTML (May contain PHP code with tags).
Le code est très simple et fonctionnait très bien jusque là.
Voici un extrait :
$id_etab=$_GET["id_dormir"];
if($id_etab!=''){
//Connexion à la base de données
$host = 'xxx';
$user = 'xxx';
$bdd = 'xxx';
$passwd ='xxx';
// Connexion au serveur
mysql_connect($host, $user,$passwd) or die("erreur de connexion au serveur");
mysql_select_db($bdd) or die("erreur de connexion a la base de donnees");
$sql=mysql_query('SELECT * FROM dormir WHERE Id_dormir="'.$id_etab.'"')or die ("Pb requette select10".mysql_error());
while($donnees_messages=mysql_fetch_assoc($sql)) // On lit les entrées
{
$id_dormir= $donnees_messages["Id_dormir"];
$email_dormir= $donnees_messages["Email_dormir"];
$nom_dormir= $donnees_messages["Nom_dormir"];
$ville_dormir= $donnees_messages["Commune_dormir"];
$adresse_dormir= $donnees_messages["Adresse_dormir"];
$cp_ville_dormir= $donnees_messages["Cp_ville_dormir"];
$tel_dormir= $donnees_messages["Tel_dormir"];
$fax_dormir= $donnees_messages["Fax_dormir"];Avant les champs était en type="hidden", je les ai mis en "text" pour voir si le code php s'exécutait. C'est à ce moment que je me suis rendu compte que non.
echo '
<input id="id_dormir" name="id_dormir" value="'.$id_dormir.'" type="text">
<input id="email_etab_dormir" name="email_etab_dormir" value="'.$email_dormir.'" type="text">
<input id="nom_dormir" name="nom_dormir" value="'.$nom_dormir.'" type="text">
<input id="ville_dormir" name="ville_dormir" value="'.$ville_dormir.'" type="text">
<input id="adresse_dormir" name="adresse_dormir" value="'.$adresse_dormir.'" type="text">
<input id="cp_ville_dormir" name="cp_ville_dormir" value="'.$cp_ville_dormir.'" type="text">
<input id="tel_dormir" name="tel_dormir" value="'.$tel_dormir.'" type="text">
<input id="fax_dormir" name="fax_dormir" value="'.$fax_dormir.'" type="text">
';
}Je ne sais pas d'où vient le problème.
Ce pourrait-il, que ce soit un changement au niveau de mon hébergeur qui provoque ça?
Ce qui est étrange c'est que ce code fonctionne dans une page externe mais pas dans le formulaire de chronoform alors qu’il fonctionnait très bien jusque là.
Si vous avez des idées sur la marche à suivre je suis preneuse.
Audrey
Hi Audrey,
The problem is one of variable 'scope'. The variables you define in the custom code only exist in that action unless you define them as 'global'. The simplest answer is to put the hidden element HTML in the same Custom Element element.
If the table is in the Joomla! database you could use a DB Record Loader to get this information. That might be much simpler.
Bob
The problem is one of variable 'scope'. The variables you define in the custom code only exist in that action unless you define them as 'global'. The simplest answer is to put the hidden element HTML in the same Custom Element element.
If the table is in the Joomla! database you could use a DB Record Loader to get this information. That might be much simpler.
Bob
Le code est bien au même endroit. Je l'ai coupé en deux uniquement pour pouvoir le commenter et l'expliquer sur le forum.
Malgré tout, j'ai essayé de créer un DB Record Loader comme vous me l'avez suggéré mais cela n'a pas fonctionné ou je n'ai pas réussi.
Mais j'ai découvert une chose très étrange. Le code php fonctionne à la condition d'ajouter de nouvelles balises php avant le code déjà transmis lors de mon précédent message. De plus, impossible de mettre une instruction "if" au code. J'ai été obligé de l'enlever pour que cela marche.
Du coup je me retrouve avec ce code :
Le code <?php ?> étant obligatoire pour que cela marche. Allez comprendre!
Dans tous les cas mon problème est résolu.
Merci d'avoir pris le temps d'essayer de m'aider.
Audrey
Malgré tout, j'ai essayé de créer un DB Record Loader comme vous me l'avez suggéré mais cela n'a pas fonctionné ou je n'ai pas réussi.
Mais j'ai découvert une chose très étrange. Le code php fonctionne à la condition d'ajouter de nouvelles balises php avant le code déjà transmis lors de mon précédent message. De plus, impossible de mettre une instruction "if" au code. J'ai été obligé de l'enlever pour que cela marche.
Du coup je me retrouve avec ce code :
<?php
echo "GET dormir ".$_GET["id_dormir"];
//Connexion ŕ la base de données
$host = 'localhost';
$user = 'ilereunion1';
$bdd = 'ilereunion1';
$passwd ='pmf69*$$HJb23';
// Connexion au serveur
mysql_connect($host, $user,$passwd) or die("erreur de connexion au serveur");
mysql_select_db($bdd) or die("erreur de connexion a la base de donnees");
$sql=mysql_query('SELECT * FROM dormir WHERE Id_dormir="'.$_GET["id_dormir"].'"')or die ("Pb requette select10".mysql_error());
//echo 'SELECT * FROM dormir WHERE Id_dormir="'.$_GET["id_dormir"].'"';
while($donnees_messages=mysql_fetch_assoc($sql)) // On lit les entrées
{
$id_dormir= $donnees_messages["Id_dormir"];
$email_dormir= $donnees_messages["Email_dormir"];
$nom_dormir= $donnees_messages["Nom_dormir"];
$ville_dormir= $donnees_messages["Commune_dormir"];
$adresse_dormir= $donnees_messages["Adresse_dormir"];
$cp_ville_dormir= $donnees_messages["Cp_ville_dormir"];
$tel_dormir= $donnees_messages["Tel_dormir"];
$fax_dormir= $donnees_messages["Fax_dormir"];
echo '<input id="id_dormir" name="id_dormir" value="'.$_GET["id_dormir"].'" type="hidden">
<input id="email_etab_dormir" name="email_etab_dormir" value="'.$email_dormir.'" type="hidden">
<input id="nom_dormir" name="nom_dormir" value="'.$nom_dormir.'" type="hidden">
<input id="ville_dormir" name="ville_dormir" value="'.$ville_dormir.'" type="hidden">
<input id="adresse_dormir" name="adresse_dormir" value="'.$adresse_dormir.'" type="hidden">
<input id="cp_ville_dormir" name="cp_ville_dormir" value="'.$cp_ville_dormir.'" type="hidden">
<input id="tel_dormir" name="tel_dormir" value="'.$tel_dormir.'" type="hidden">
<input id="fax_dormir" name="fax_dormir" value="'.$fax_dormir.'" type="hidden">';
}
?>
<?php
?>Le code <?php ?> étant obligatoire pour que cela marche. Allez comprendre!
Dans tous les cas mon problème est résolu.
Merci d'avoir pris le temps d'essayer de m'aider.
Audrey
This topic is locked and no more replies can be posted.
