Partage
  • Partager sur Facebook
  • Partager sur Twitter

Ajax et PHP

Problème de script

Sujet résolu
    25 juillet 2009 à 10:46:50

    Bonjour,
    Ayant fait un script pour un site de football qui doit afficher tous les jours les personnes ayant anniversaire ce jour-ci. J'ai donc opté pour de l'AJAX vu que l'hébergeur ou est stocké le site de football ne prend pas en charge le PHP ni la BDD. J'ai donc crée une base de donnée sur mon hébergeur (dixkey) et y ai stocké tous les anniversaires.
    Le problème est le suivant : lorsque je teste le code en mettant la page du site de foot sur un hébergeur qui accepte le PHP ça marche super ( voyey le ici ). Par contre et ce que je veux c'est mettre la page du site de foot sur leur propre hébergeur qui n'accepte pas le PHP, et la ça ne marche pas aucun anniversaire ne s'affiche au-dessus de "Rejoindre le FCM..." (voyez le ici ).
    Donc voila le code source de la page du foot :
    <html>
    
     <head>
      <title>Football Club de Monswiller</title>
      <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
      <meta name="ProgId" content="FrontPage.Editor.Document">
      <meta name="description" content="Tout sur le Football Club de Monswiller">
      <meta name="keywords" content="football,club,monswiller,FCM,F.C.M.,FC Monswiller">
      
      <script type="text/javascript">
      
      function getXMLHttpRequest() {
    	var xhr = null;
    	
    	if (window.XMLHttpRequest || window.ActiveXObject) {
    		if (window.ActiveXObject) {
    			try {
    				xhr = new ActiveXObject("Msxml2.XMLHTTP");
    			} catch(e) {
    				xhr = new ActiveXObject("Microsoft.XMLHTTP");
    			}
    		} else {
    			xhr = new XMLHttpRequest(); 
    		}
    	} else {
    		alert("Votre navigateur ne supporte pas l'objet XMLHTTPRequest...");
    		return null;
    	}
    	
    	return xhr;
    }
    
      
      </script>
    
    <script type="text/javascript" src="http://quentin.dixkey.com/anniv/anniv.js"></script>
    
      <script type="text/javascript">
        <!--
        window.onload=montre;
        function montre(id) {
        var d = document.getElementById(id);
        	for (var i = 1; i<=10; i++) {
    		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
    	    }
        if (d) {d.style.display='block';}
        }
        //-->
        </script>
    
    
    <!-- DEBUT DU SCRIPT affichache date-->
    <SCRIPT LANGUAGE="JavaScript">
    /*
    SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
    http://www.editeurjavascript.com
    */
    navvers = navigator.appVersion.substring(0,1);
    if (navvers > 3)
    	navok = true;
    else
    	navok = false;
    
    today = new Date;
    jour = today.getDay();
    numero = today.getDate();
    if (numero<10)
    	numero = "0"+numero;
    mois = today.getMonth();
    if (navok)
    	annee = today.getFullYear();
    else
    	annee = today.getYear();
    TabJour = new Array("Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi");
    TabMois = new Array("janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre");
    messageDate = TabJour[jour] + " " + numero + " " + TabMois[mois] + " " + annee;
    </SCRIPT>
    <!-- FIN DU SCRIPT affichage date-->
    
    
    
      <style type="text/css">
        <!-- 
        body {
          background-color: #dddddd;
          color: #000000;
          margin-top: 10px;
          margin-left: 10px;
          margin-right: 10px;
          margin-bottom: 10px;
          /*margin: 0;
          padding: 0;*/
          background-image:url(images/fondpageaccueil.jpg);
          background-repeat:no-repeat;
          font: 80% verdana, arial, sans-serif;
        }
        
        dl, dt, dd, ul, li {
          margin: 0;
          padding: 0;
          list-style-type: none;
        }
        
        #menu {
          position: absolute;
          top: 140px;
          left: 200px;
          z-index:100;
          width: 800px;
          font-family : comic sans ms; /* on utilise Arial c'est plus beau  */
          font-size : 13px; /* hauteur du texte : 12 pixels */
        }
        
        #menu dl {
          float: left;
          width: 120px;
          /*margin: 0 1px;*/
        }
    
        #menu dt {
          cursor: pointer;
          text-align: center;
          font-weight: bold;
          background: #cccccc;
          /*border: 1px solid gray;*/
        }
    
        #menu dd {
          /*border: 1px solid gray;*/
        }
    
        #menu li {
          text-align: center;
          background: #cccccc;
        }
    
        #menu li a, #menu dt a {
          color: #000000;
          text-decoration: none;
          display: block;
          height: 100%;
          border: 0 none;
        }
    
        #menu li a:hover, #menu dt a:hover {
          background: #dddddd;
        }
    
        #titre /* boite titre*/
        {
          position: absolute;
          top: 10px;
          left: 150px;
          width: 850px;
          height: 100 px;
        }
    
        #date /* boite date*/
        {
          position: absolute;
          top: 170px;
          left: 200px;
          width: 780px;
          height: 30 px;
          padding: 10px;
          overflow: hidden;
          color: #000000;
          text-align: left;
          font-family: "Times New Roman", Times, Georgia, serif;
          font-size : 10px;
    
        }
    
        #info /* boite à infos principale*/
        {
          position: absolute;
          top: 200px;
          left: 200px;
          width: 550px;
          border-right: solid;
          border-top: solid;
          border-width: 1px;
          padding: 10px;
          overflow: hidden;
          /*background: #ffffff;*/
          color: #000000;
          text-align: left;
          font-family: "Times New Roman", Times, Georgia, serif;
          font-size : 14px;
        }
    
        #infodroite /* boite à infos de droite */
        {
          position: absolute;
          top: 200px;
          left: 780px;
          width: 190px;
          border-left: solid;
          border-top: solid;
          border-width: 1px;
          padding: 10px;
          overflow: hidden;
          /*background: #ffffff;*/
          color: #000000;
          text-align: left;
          font-family: "Times New Roman", Times, Georgia, serif;
          font-size : 14px;
        }
    
    
    
    -->
    
    </style>
      <link rel='SHORTCUT ICON' type="image/x-icon" href='http://pagesperso-orange.fr/fcmonswiller/favicon.ico'>
    </head>
    
    <body link="#008080" vlink="#808080" alink="#FF0000" onLoad="request(readData);">
    
       <div id="titre">
       <center> <img src="images/logofcmtransparent.gif" alt="logo FCM" width="69" height="86" />
       <img border="0" src="images/titrepassionnement.gif" width="507" height="86"> <img src="images/ballontitre.gif" alt="ballon" width="58" height="51" /> </center>
       </div>
    
       <div id="menu">
    
    	<dl>
    		<dt onmouseover="javascript:montre();"><a href="" title="Retour à l'accueil">Accueil</a></dt>
    	</dl>
    	
    	<dl>			
    		<dt onmouseover="javascript:montre('smenu1')" ;>Le club</dt>
    			<dd id="smenu1" onmouseover="javascript:montre('smenu1');" onmouseout="javascript:montre('');">
    
    				  <ul onmouseout="javascript:montre();">
    
    				  <li><a href="pages/village.htm">Le village</a></li>
    
                    <li><a href="pages/enbref.htm">En bref</a></li>
                    <li><a href="pages/historique.htm">Historique</a></li>
                    <li><a href="pages/comitearbitres.htm">Comité et arbitres</a></li>
    				</ul>
    
    			</dd>
    
    	</dl>
    	
    	
    	<dl>	
    		<dt onmouseover="javascript:montre('smenu2')" ;>L'école de foot</dt>
    
    			<dd id="smenu2" onmouseover="javascript:montre('smenu2');" onmouseout="javascript:montre('');">
    				<ul onmouseout="javascript:montre();">
    				  <li><a href="pages/charte.htm">Charte</a></li>
    
                    <li><a href="equipes/debutants.htm">Débutants</a></li>
    
                    <li><a href="equipes/poussins.htm">Poussins 1, 2 et 3</a></li>
                    <li><a href="equipes/benjamins.htm" >U13 1 et 2</a></li>         
    				</ul>
    
    			</dd>
    	</dl>
    	
    	<dl>	
    		<dt onmouseover="javascript:montre('smenu3')" ;>Les équipes</dt>
    
    			<dd id="smenu3" onmouseover="javascript:montre('smenu3');" onmouseout="javascript:montre('');">
    
    				<ul onmouseout="javascript:montre();">
    				  <li><a href="equipes/13ans.htm">U15</a></li>
                    <li><a href="equipes/15ans.htm">U17</a></li>
    
                    <li><a href="equipes/18ans.htm">U19</a></li>
                    <li><a href="equipes/feminines.htm">Féminines</a></li>
    
                    <li><a href="equipes/seniors2.htm">Seniors 2</a></li>
    
                    <li><a href="equipes/seniors1.htm">Seniors 1</a></li>
                    <li><a href="equipes/veterans.htm" >Vétérans</a></li>            
    				</ul>
    			</dd>
    
    	</dl>
    	
    	<dl>	
    		<dt onmouseover="javascript:montre('smenu4');">Les matchs</dt>
    
    			<dd id="smenu4" onmouseover="javascript:montre('smenu4');" onmouseout="javascript:montre('');">
    
    				<ul onmouseout="javascript:montre();">
    				  <li><a href="http://lafa.fff.fr/cgi-bin/clubs/clubs_compet_rechguid_resu.pl?club=500199">Calendriers</a></li>
                    <li><a href="http://lafa.fff.fr/cgi-bin/clubs/clubs_agenda.pl?numclub=500199">Prochains matchs</a></li>
                    <li><a href="http://lafa.fff.fr/cgi-bin/clubs/clubs_resu.pl?numclub=500199">Résultats</a></li>
    
                    <li><a href="http://lafa.fff.fr/cgi-bin/clubs/clubs_listcompet_clas.pl?numclub=500199" >Classements</a></li>
    
    				</ul>
    
    			</dd>
    	</dl>
    	
    	<dl>	
    		<dt onmouseover="javascript:montre('smenu5');">Divers</dt>
    			<dd id="smenu5" onmouseover="javascript:montre('smenu5');" onmouseout="javascript:montre('');">
    				<ul onmouseout="javascript:montre();">
    
    				  <li><a href="pages/agenda.htm">Agenda</a></li>
    
                    <li><a href="pages/anniversaires.htm">Anniversaires</a></li>            
                    <li><a href="pages/archives.htm">Archives</a></li>
    
                    <li><a href="pages/contacts.htm">Contacts</a></li>
                    <li><a href="pages/detections.htm">Détections</a></li>
                    <li><a href="pages/liens.htm">Liens</a></li>
    
                    
                  
                    <li><a href="http://www.livre-dor.net/livre.php?livredor=22910">Livre d'or</a></li>
    
                   
                    
                    <li><a href="pages/location.htm">Location</a></li>
                    <li><a href="pages/sponsor.htm">Partenaires</a></li>
    
                    <li><a href="pages/news.htm">Recevoir les news</a></li>
                    <li><a href="pages/sondages.htm">Sondages</a></li>
                    <li><a href="pages/telechargements.htm">Téléchargements</a></li>
    
                    <li><a href="pages/webcam.htm" >Webcam</a></li>            
    				</ul>
    			</dd>
    	</dl>
    
    	</div>   
    
      <div id="date">
      
      <table width="760" cellspacing="0" cellpadding="0" >
        <tr>
          <td align="left">
    
          <font size="2" color="#0000FF"><i>
    <!-- DEBUT DU SCRIPT affichage date -->
    <SCRIPT LANGUAGE="JavaScript">
    /*
    SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
    http://www.editeurjavascript.com
    */
    document.write(messageDate);
    </SCRIPT>
    <!-- FIN DU SCRIPT affichage date -->
        </i></font>
    
        </td>
        <td align="right">
        <font size="2" color="#0000FF"><i>
    <!-- DEBUT DU SCRIPT affichage dicton -->
    
    Dicton du jour : 
    <script LANGUAGE="JavaScript"> 
    <!-- 
    var d = new Date(); 
    //tableau contenant les messages 
    var tab = new Array(7); 
    tab[0] = "Quand avril commence trop doux, il finit pire que tout."; 
    tab[1] = "Quant on a un sou dans sa poche le 1er avril, on en a toute l'année."; 
    tab[2] = "En avril, le sureau doit fleurir, sinon le paysan va souffrir."; 
    tab[3] = "En avril, s'il pleut le 3, il pleuvra tout le mois."; 
    tab[4] = "En avril ne quittes pas un fil, en mai fais ce qu’il te plaît..."; 
    tab[5] = "Ciel rouge au matin est pluvieux voisin."; 
    tab[6] = "D'avril les ondées font les fleurs de mai."; 
    
    document.write(tab[d.getDay()]); 
    //--> 
    
    </script>
    <!-- FIN DU SCRIPT affichage dicton -->
        
        <!-- Autres dictons
    Avril venteux, avril trop beau n'apporte rien de bon.
    
    
    
    Le premier avril, il faut que le pinson boive au buisson.
    
    Quant on a un sou dans sa poche le 1er avril, on en a toute l'année.
    
    Avril tantôt pleure, tantôt rit !
    
    Mars gris, avril pluvieux, font l'an fertile et plantureux.
    
    En avril, s'il pleut le 3, il pleuvra tout le mois.
    
    Quand il pleut en avril, tu peux faire réparer le fond du tonneau.
    
    A la Saint-Isidore(04/04), si le soleil dore, le blé sera haut et charnu, mais le pommier sera nu.
    
    D'avril les ondées font les fleurs de mai.
    
    On a pas hiberné tant qu'avril n'est pas passé.
    
    En avril, le sureau doit fleurir, sinon le paysan va souffrir.
    
    Lune rousse sur la semence aura toujours mauvaise influence.
    
    Le 5 avril, le coucou chante mort ou vif !
    
    Pâques tôt ou pâques tard, un bon merle a ses petit à Pâques.
    
    Il n'est si gentil mois d'avril qui n'ait son chapeau de grésil.
    
    Avril fait la fleur, mai en a l’honneur.
    
    Avril est cousu de mauvais fils.
    
    A la saint-Gautier (9/04), jamais le jour entier ne passe sans quelques giboulées.
    
    A la Saint-Fulbert (10/04), on reçoit les giboulées pour l'hiver.
    
    S'il gèle à la Saint-Stanislas (11/04), on aura deux jours de glace.
    
    En avril ne quittes pas un fil, en mai fais ce qu’il te plaît...
    
    A la Saint-Jules (12/04), mauvais temps n'est pas installé pour longtemps.
    
    Ne croit pas de l'hiver avoir atteint la fin, que la lune d'avril ait accompli son plein.
    
    L'hiver n'est terminé que quand la lune rousse a décliné.
    
    Lune d'avril nouvelle ne passe pas sans gel.
    
    Sainte semaine mouillée donne terre altérée.
    
    Sainte semaine pluvieuse, année ruineuse.
    
    S'il neige le Vendredi-Saint, les autres gelées sont avortées.
    
    La Lune rousse donne tout ou bien elle l'ôte.
    
    Caprice d'avril fait tomber les fleurs et trembler les laboureurs.
    
    Le vent qui souffle pendant la messe des Rameaux, sera le vent dominant de l'année.
    
    Ciel rouge au matin est pluvieux voisin.
    
    Si le vent souffle la veille de Pâques, il soufflera pendant six semaines.
    
    Fleur d’avril ne tient qu’à un fil.
    
    Quand de Saint-Paterne (15/04) vient la saison, le chaleur vient pour de bon.
    
    Quand avril est froid et pluvieux, les moissons n'en sont que mieux.
    
    A la Saint-Anicet (17/04), le coucou chante s'il ne fait pas trop frais.
    
    Le vent d’avril n’a pas d’asile.
    
    A la saint-Théodore ((20/04), fleurit chaque bouton d'or.
    
    Quand le coq boît, le pluie n'est pas loin.
    
    A la Saint-Anselme (21/04), dernières fleurs sème.
    
    Pluie de Saint-Georges (23/04), sur cent cerises en reste quatorze.
    
    Saint-Marc (25/04) mouillé au petit jour, c'est de la pluie pour tout le jour.
    
    S'il pleut à la Saint-Marc (25/04), il y aura des prunes toute l'année.
    
    Chaque goutte d'avril en vaut mille.
    
    A la Saint-Robert (30/04), tout arbre est vert.
    
    La pluie, le jour de la Saint-Robert (30/04), de bon vin remplira ton verre.
    
    Printemps pluvieux, beaucoup de foin, peu de blé.
    
    S'il tonne en avril, vigneron prépare ton baril.
    
    Jamais pluie de printemps n'a passé pour mauvais temps.
    
    Petite pluie d'Avril salit la terre, grande pluie l'approprie.
    
    Quand Pâques marine, peste et famine !   Fin autres dictons-->
    
        </i></font>
        </td>
    
        </tr>
      </table>
      </div>
    
      
      <div id="info">
    
        
       <div align="center">
        <center>
        <table border="0" cellpadding="2" cellspacing="0" width="95%">
          <tr>
    
            <td width="33%">
            </td>
            <td width="33%">
    
              <p align="center"></td>
            <td width="34%">
    
              <p align="center"></td>
          </tr>
        </table>
    
        </center>
       </div>
        
       <p align="center" style="line-height: 130%; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6">&nbsp;
    
        
       <p align="center" style="line-height: 130%; text-indent: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"> <font color="#008000" face="Goudy Stout" size="4">Actualités</font>
        
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6">&nbsp;</p>
    
        
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><b><i><font size="3">Sortie
       VTT</font></i></b></p>
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3">Une
       sortie VTT est prévue pour les membres du FCM le dimanche 26 juillet.
       Parcours d'environ 35km. Difficulté moyenne. Départ du club-house du FCM à
       9h précise.</font></p>
    
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3">Renseignement
       auprès de Guillaume au 06 24 62 59 15.</font></p>
    
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><img border="0" src="images/ballon.gif" width="25" height="26">
       </p>
        
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><b><i><font size="3">On
       pense déjà à la reprise...</font></i></b></p>
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3"><a href="autrespages/infoprogrammereprise.htm">Cliquez
       ici</a> pour voir le programme de reprise de toutes les équipes du FCM.</font></p>
    
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3">(Programme
       de l'équipe fanion disponible)</font></p>
    
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><img border="0" src="images/ballon.gif" width="25" height="26">
       </p>
        
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3" color="#0000FF"><i><b>ATTENTION
       :&nbsp; </b></i></font></p>
        
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3" color="#0000FF">Le
       site a été mis à jour pour la saison 2009/2010. Vous pouvez retrouver en
       archives 2008/2009 le bilan de la saison écoulée et une photo de chaque
       équipe.&nbsp;</font></p>
        
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><b><i><font color="#FF0000" size="4">&nbsp;</font></i></b><img border="0" src="images/ballon.gif" width="25" height="26">
       </p>
    
        
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><b><i><font size="3">Survêtement
       à vendre</font></i></b></p>
    
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3">Il
       reste un survêtement Adidas (dernier modèle) aux couleurs du FCM, taille 10
       ans, à vendre (40 €).</font></p>
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3">Réservez-le
       par mail sur l'adresse du FCM. (Voir 'Divers - Contacts')&nbsp;</font></p>
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><img border="0" src="images/ballon.gif" width="25" height="26">
       </p>
        
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><b><i><font size="3">Bilan
       de la saison 2009/2010</font></i></b></p>
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3"><a href="pdf/bilanequipes20082009.pdf" target="_blank">Cliquez
       ici</a> pour voir le bilan de la saison de toutes les équipes du FCM, en
       championnat et en coupe.</font></p>
    
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><img border="0" src="images/ballon.gif" width="25" height="26">
       </p>
        
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><b><i><font size="3">Nouvelles
       catégories, licences, mutations, ...</font></i></b></p>
       <p align="center" style="text-indent: 0; line-height: 130%; word-spacing: 0; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6"><font size="3">...
       pour la saison 2009/2010. Un coup d'oeil rapide des nouvelles dispositions en
       <a href="images/resumenouvelleregle.JPG" target="_blank">cliquant ici </a>(Alsace
       Foot du 13/05/09).</font></p>
       <p align="center" style="text-indent: 0; line-height: 130%; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6">&nbsp;<img border="0" src="images/ballon.gif" width="25" height="26">
       <p align="center" style="text-indent: 0; line-height: 130%; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 6">&nbsp;<i><font size="3"><b>Dernières
       mises
       à jour </b></font><font color="#0000FF" size="1">(au <!--webbot bot="Timestamp" S-Type="EDITED"
       S-Format="%d/%m/%Y" startspan -->25/07/2009<!--webbot bot="Timestamp" endspan i-checksum="12618" -->
    
       )</font></i></p>
        <center>
        <table border="1" cellspacing="0" width="95%" cellpadding="3" bgcolor="#CCCCCC" bordercolor="#DDDDDD" bordercolorlight="#DDDDDD" bordercolordark="#DDDDDD">
          <tr>
            <td width="30%" align="center">
              <p style="margin: 0"><i>Où ?</i></td>
            <td width="70%" align="center">
    
              <p style="margin: 0"><i>Quoi ?</i></td>
    
          </tr>
        </center>
        <tr>
            <td width="30%" align="center"> 
              Ci-contre
            </td>
            <td width="70%">Nouveau sondage.&nbsp; <font size="1" color="#0000FF"><i>19/07/09</i></font></td>
    
        </tr>
    
        <tr>
            <td width="30%" align="center"> 
              'Divers - Agenda'
            </td>
            <td width="70%">Réunion de comité fixée au jeudi 23 juillet.&nbsp; <font size="1" color="#0000FF"><i>18/07/09</i></font></td>
    
        </tr>
        <tr>
    
            <td width="30%" align="center"> 
              Ci-dessus
            </td>
    
            <td width="70%">Sortie VTT.&nbsp; <font size="1" color="#0000FF"><i>15/07/09</i></font></td>
        </tr>
    
        <tr>
            <td width="30%" align="center"> 
              'Divers - Locations'
            </td>
    
            <td width="70%">Planning de location du club-house mis à jour.&nbsp; <font size="1" color="#0000FF"><i>4/07/09</i></font></td>
    
        </tr>
        <tr>
    
            <td width="30%" align="center"> 
              'Divers - Anniversaires'
            </td>
            <td width="70%">24 anniversaires à souhaiter en juillet.&nbsp;
    
              <font size="1" color="#0000FF"><i>1/07/09</i></font></td>
        </tr>
        <tr>
    
            <td width="30%" align="center"> 
              'Divers - Téléchargements'
            </td>
    
            <td width="70%">Trois nouveaux documents pour la saison 2009/2010 à
              consulter ou télécharger (stages éducateurs, réglementation des
              jeunes, calendrier général).&nbsp; <font size="1" color="#0000FF"><i>30/06/09</i></font></td>
    
        </tr>
        <center>
        </table>
        </center>
    
            <p align="center" style="text-indent: 10; margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5">&nbsp;</p>
    
      </div>
      
      <div id="infodroite">
      <p>
    
    	<div id="output"></div>
    </p>
      
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><font color="#008000"><b>Rejoindre
      le FCM pour</b></font></p>
      
      
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><font color="#008000"><b>la
      saison </b></font><font color="#008000"><b>2009
      /2010</b></font></p>
    
      
      
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><a href="autrespages/inforejoindrelefcm.htm" target="_self"><img border="0" src="images/signer.gif" title="Cliquez ici pour tout savoir !" width="47" height="48"></a></p>
      
      
    <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center">&nbsp;_________________</p>
    
      
      
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><font color="#008000"><b>Livre
      d'or</b></font></p>
    
      
    
      
      
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><a href="http://www.livre-dor.net/livre.php?livredor=22910"><img border="0" src="images/livredor.gif" title="Laissez vos commentaires ici !" width="50" height="50"> </a></p>
      
      
      
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center">&nbsp;_________________</p>
      
    
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><font color="#008000"><b>Sondage
      </b>(19/07/09)</font></p>
    
      
      
      <!-- Début sondage -->
    
    <form action="http://quentin.dixkey.com/affichage_sondage.php" method="post"> <p><center>Une sortie VTT,
      intéressé(e) ?</center></p>
    
    <input type="radio" name="reponses" value="1" />oui<br/>
    
    <input type="radio" name="reponses" value="2" />peut-être<br/>
    
    <input type="radio" name="reponses" value="3" />pas du tout<br/>
    
    <center><p> <input type="submit" value="Voter" /><p></form></center><center><input type="button" onclick="document.location.href='http://quentin.dixkey.com/affichage_sondage.php';" value="Voir" /></center>
    
    <!-- Fin sondage -->
    
    
    <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><a href="pages/sondages.htm"><img border="0" src="images/sondage.gif" title="Résultats des précédents sondages, cliquez ici" width="55" height="66"></a></p>
    
      
      
      
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center">&nbsp;_________________</p>
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><font size="2" color="#008000"><b>Accès rapide</b></font>
      </p>
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><i><font size="2"><a href="http://www.google.fr/">Google</a>
    
      - <a href="http://lafa.fff.fr/cg/0300/www/actu/index.shtml">Lafa</a> - <a href="http://www.fff.fr/servfff/extraclub/index.php">FootClub</a>
    
      - <a href="http://www.viamichelin.com/viamichelin/fra/dyn/controller/Itineraires">ViaMichelin</a>
      - <a href="http://www.meteo-strasbourg.net/?rub=ttprev">Météo</a></font>
      </i></p>
    
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center">&nbsp;_________________</p>
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><a href="http://www.cc-saverne.fr/communes/monswiller/" target="_blank"><img border="0" src="images/logomonswiller.gif" title="Le site Internet de la commune de Monswiller" width="53" height="63"></a></p>
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center">&nbsp;_________________</p>
    
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center">&nbsp;&nbsp;&nbsp;
      <img src="http://pages.perso.orange.fr/client/php/compteur.php?url=fcmonswiller&df=compteur&dd=E&frgb=dddddd&ft=1&tr=y&md=6&pad=n&comma=n"> 
      visiteurs depuis le 30 juillet 2008</p>
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center">&nbsp;&nbsp;_________________
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><font size="2">Site
      adapté pour un affichage</font><p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center"><font size="2">1024
      x 768</font>
    
      <p style="margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 5" align="center">&nbsp;
     
     
      </div>
    
      
      
     </body>
    
    </html>
    

    Comme vous le voyez on appelle un script externe qui se trouve sur mon hébergeur ( anniv.js ) dont voici le code source :
    function request(callback) {
    	var xhr = getXMLHttpRequest();
    	
    	xhr.onreadystatechange = function() {
    		if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
    			callback(xhr.responseXML);
    		}
    	};
    	
    	xhr.open("GET", "anniv.php", true);
    	xhr.send(null);
    }
    
    function readData(oData) {
    	var nodes = oData.getElementsByTagName("soft");
    	var ol = document.createElement("ol"), li, cn;
    	
    	for (var i=0, c=nodes.length; i<c; i++) {
    		li = document.createElement("li");
    		cn = document.createTextNode(nodes[i].getAttribute("name"));
    		
    		li.appendChild(cn);
    		ol.appendChild(li);
    	}
    	
    	document.getElementById("output").appendChild(ol);
    }
    

    Comme on peut le voir AJAX envoie une requête sur le fichier anniv.php qui se trouve sur mon hébergeur et dans le même dossier que anniv.js .
    Voici le code source de anniv.php :
    <?php
    
    header("Content-Type: text/xml");
    
    mysql_connect("localhost", "login", "mdp");
       mysql_select_db("login");
       
    $jour = date('d');
    $mois = date('m');
    
    
    
    $reponse = mysql_query("SELECT * FROM anniv");
    echo "<root>";
    $return = mysql_query("SELECT * FROM anniv WHERE jour='$jour' AND mois='$mois'");
    $nbre_personnes = mysql_num_rows($return);
    
    	while($donnee = mysql_fetch_array($return))
    	{
    		if ($nbre_personnes >= 1)
    		{
    		$nom = $donnee['nom'];
    		$prenom = $donnee['prenom'];
    			echo '<soft name="' . $nom .' ' . $prenom .'" />';
    	
    			
    		}	
    	}	
    if ($nbre_personnes == 0)
    {
    echo '<soft name="Aucun anniversaire" />';
    }
    
    echo '</root>';
    
    ?>
    


    Voila tous les codes sources, j'espère que vous pourrez m'aider.
    Merci d'avance.
    • Partager sur Facebook
    • Partager sur Twitter
      25 juillet 2009 à 19:07:23

      C'est surement dû aux restrictions du Same Origin Policy d'Ajax...

      Ajax ne peut pas envoyer de requêtes vers un autre serveur.
      • Partager sur Facebook
      • Partager sur Twitter
        26 juillet 2009 à 16:35:29

        Oui mais le fichier contenant la requête AJAX est déjà sur l'autre serveur.
        Et je sais que ce que je veux faire a une solution car des services comme XITI ou les sondages, etc on n'est pas obligé d'avoir un hébergeur PHP pour utiliser ces services.
        Merci pour ta réponse.
        • Partager sur Facebook
        • Partager sur Twitter
          26 juillet 2009 à 18:52:50

          Je maintiens ce que j'ai dit cependant. Le Same Origin Policy s'applique à la page dans laquelle est inséré le script, peu importe où il est hébergé.

          Donc le JavaScript s'exécute sur ton serveur sans PHP. Aussi, la communication avec le serveur ayant PHP est bloqué par les restrictions du Same Origin Policy d'Ajax.

          Va voir le tuto Ajax, tu trouveras quelques infos pour faire des échanges cross-domain je crois.

          http://www.siteduzero.com/tutoriel-3-4 [...] vascript.html
          • Partager sur Facebook
          • Partager sur Twitter
            26 juillet 2009 à 22:40:59

            Merci beaucoup pour ta réponse et ton aide je vais voir de ce côté je te tiens au courant si ça marche.
            Encore merci.
            • Partager sur Facebook
            • Partager sur Twitter
              31 juillet 2009 à 10:32:51

              C'est bon ça marche.
              Merci beaucoup Golmote.
              Sujet résolu !
              • Partager sur Facebook
              • Partager sur Twitter

              Ajax et PHP

              × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
              × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
              • Editeur
              • Markdown