Reload of php file to div in lightbox-style

Reload of php file to div in lightbox-style

Hi everybody,

sorry for asking such a maybe dumb question, but something isn't working out like I except it.

I have two php files, one you can see as index.php, the other should have some content from different db-queries.

The first one (index.php) contains a table with weekdays as rows and columns for what you like.

Every different cell-click to this table should do a different db-query. If I click monday, column 1 it probably will query "select release from os", if I click on column 2 "select * from hardware" for example.

To get into code I have this, what is executed:

function click_menu(element)
{
   
    myRow = getRow(element);
    myColumn = getColumn(element);
      
    //alert("click on row " + myRow + " column " + myColumn);
   
    // load content of menu.php to div_menu
    //$(document).ready(function()
    //{
       
        $("#div_menu").load("menu.php?var=sql1")
       
        //$("#refresh").click(function(evt)
        //{
        //    $("#div_menu").load("menu.php")
        //    evt.preventDefault();
        //})
    //})
   
    document.getElementById('div_menu').style.display='block';
    document.getElementById('fade').style.display='block';
       
}

I expected from this line:
            $("#div_menu").load("menu.php?var=sql1")
to reload menu.php and put it into #div_menu, which is defined in index.php.

But instead it loads only once, and then no more.
I thought if I make changes to menu.php and reload the side at least with Ctrl+F5, it will represent this, but it is doing not, it stays at the first loaded content, until I close and reopen IE.

To complete this here is the menu.php:
                                                                                                                                                        
<?php
      include("dbcon.php");
?>
                                                                                                                                                    
<?php
      #$result= mysql_query($HTTP_GET_VARS["var"]);
      $result= mysql_query("SELECT * FROM user");
      while($row = mysql_fetch_object($result))
      {
            echo $row->Username;
      }                                                                                                                                               
?>                                                                                                                                                    
<a href = "javascript:void(0)" onclick = "document.getElementById('div_menu').style.display='none';document.getElementById('fade').style.display='none'">
Close
</a>                                                                                                                                                    

I'am thankful for any helpful suggestions. Thanks.































































    • Topic Participants

    • hm