hello,
i have this error Error: the xajax Javascript component could not be included. Perhaps the URL is incorrect?
URL: /xampp/htdocs/xajax_js/xajax_core.js
please can anyone help me see my code
Thanks
i have this error Error: the xajax Javascript component could not be included. Perhaps the URL is incorrect?
URL: /xampp/htdocs/xajax_js/xajax_core.js
please can anyone help me see my code
Code:
<?php $host_db="localhost"; $user_db="root"; $password_db=""; $bdd_db="leaderprice_test"; $connect_db = mysql_connect($host_db,$user_db,$password_db); mysql_select_db($bdd_db,$connect_db); require_once("/xampp/htdocs/xajax_core/xajax.inc.php"); function SelectSouscat($catid) { $options=""; // créé un nouvel objet permettant d'envoyer une réponse au côté client $objResponse = new xajaxResponse(); // on selectionne les sous-catégorie en fonction de l'id de la catégorie mère $sql="SELECT id_mag,cp,nom_mag FROM liste_magasins WHERE cp = '".$catid."'"; $req=mysql_query($sql); while ($souscat = mysql_fetch_array($req)) { // on place toutes les sous-catégories dans des options valables pour la liste SELECT $options .= '<option value="'.$souscat['id_mag'].'">'.$souscat['nom_mag'].'</option>'; } $objResponse->addAssign("liste_magasin","innerHTML",$options); // envoie la réponse en XML return $objResponse->getXML(); } $xajax = new xajax(); //$xajax->debugOn(); $xajax->registerFunction("SelectSouscat"); $xajax->processRequest(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php $xajax->printJavascript("/xampp/htdocs") ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Document sans titre</title> </head> <body> <form action="form.php" method="post"> <table width="437" border="0"> <tr> <td><label>Nom :</label> </td> <td><input name="nom" type="text" /> </td> </tr> <tr> <td><label>Prénom</label> </td> <td><input name="prenom" type="text" /> </td> </tr> <tr> <td><label>Date de naissance (JJ/MM/AAAA)</label> </td> <td><input name="date" type="text" /> </td> </tr> <tr> <td><label>Votre code postal</label> </td> <td><input name="codepostale" type="text" id="code" onchange="xajax_SelectSouscat(this.value)"/> </td> </tr> <tr> <td><label>Séléctionnez votre magasins parmis la liste ci-dessous:</label> </td> <td><select name="magasin" id="liste_magasin"></select><br /> </td> </tr> <tr> <td><label>Votre adresse e-mail :</label> </td> <td><input name="email" type="text" /> </td> </tr> <tr> <td><label>N° de mobile* :</label> </td> <td><input name="mobile" type="text" /> </td> </tr> <tr> <td align="right"><p> </p> <p> <input name="valider" type="button" value="VALIDER" /> </p> <p> </p></td> </tr> <tr> <td>*Champs facultatifs</td> </tr> </table> <label></label> <br /> </body> </html>
Comment