The Photo.php file is expected to show a message.
But when I add ?page=2 to address it doesn't call Photos function to open the Photo.php file.
function Photos() {
var opt = <?php echo $_GET['page'];?>
alert(opt);
if(window.XMLHttpRequest)
{
xmlhttp = new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("Results").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET","Photo.php?page="+opt,true);
xmlhttp.send();
}
function showCat(option){
....
}
<?php
if(isset($_GET['page'])){
echo '<script type="text/javascript">'
,'myPhotos();'
, '</script>';
}
echo 'Results go here';
?>
photo.php
if(isset($_GET["page"])){
echo "photo";
}