joomla - Can't call PHP contents from another file -


i'm developing joomla module, , i'm testing basic approach. have first file:

file1.php

<?php defined('_jexec') or die('direct access location not allowed.'); $advisualv2jmodphp_ver='0.3.0070'; $station_id = $params->get('station_id');  $start=0; $page=10; echo 'avviamo la procedura 0.0.66 - '.$station_id.'<br>'; echo '<div id="tabellaeventi"></div>'; echo '<input type="button" value="avanti" onclick="avanti()"> '; echo '<input type="button" value="indietro" onclick="indietro()"> '; echo '<br>'; ?>  <script>  function avanti() {     xmlhttp=new xmlhttprequest();     xmlhttp.onreadystatechange=function()         {         if (xmlhttp.readystate==4 && xmlhttp.status==200)             {             esito=xmlhttp.responsetext;             }         }     xmlhttp.open('get','displayevents.php',false);     xmlhttp.send(); //  document.write(esito);     document.getelementbyid('tabellaeventi').innerhtml='clicco questo avanti'; }  function indietro() {     document.getelementbyid('tabellaeventi').innerhtml='pulsante indietro nella div<br>questo su due righe<br>'; } </script> 

here there file displayevents.php:

<?php echo 'da qui siamo nella routine display<br>'; echo 'procediamo pure<br>'; ?> 

i've used other times way, xmlhttprequest put text output of file displayevents.php , put in variable evento, can print or want. not work.

i've used way other times in html file php, time php php, can't understand.

where i'm wrong time? thank help.

with information provided, curious see if issue path's.

change:

xmlhttp.open('get','displayevents.php',false); 

to:

xmlhttp.open('get','/displayevents.php',false);     

use chrome's developer console or firefox , firebug , @ response on network tabs. show status , response codes clearly.

also, take @ access_logs , see if there entries calls displayevents.php file.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -