I have div.js which is for popup in this i define 2 function

getPageSize(); and getPageScroll();

and other file a.php and b.php in a.php as below

<script language=Javascript>

function divOn (aId_task)
{
var arrayPageSize = getPageSize();
var arrayPageScroll = getPageScroll();
//bgrnd4 = '<div style="position:absolute; top:0; left:0; width:100%; height:100%; z-index:300; background-color:#000000; -moz-opacity: 0.6; opacity:.60; filter: alpha(opacity=60);" id=overlay></div>';
    //bgrnd4 = '<div style="position:absolute; top:0; left:0; width: ' + arrayPageSize[0] + '; height:' + arrayPageSize[1] + '; z-index:300; background-color:#000000; -moz-opacity: 0.6; opacity:.60; filter: alpha(opacity=60);" id="overlay"></div>';
bgrnd4 = '<div style="position:absolute; top:0; left:0; width: 100%; height:' + arrayPageSize[1] + '; z-index:300; background-color:#000000; -moz-opacity: 0.6; opacity:.60; filter: alpha(opacity=60);" id="overlay"></div>';
document.getElementById("div_popup").innerHTML = bgrnd4;
var objFlash = document.getElementById('divek');
objFlash.style.visibility = "visible";
objFlash.style.display = 'block';
objFlash.style.border = "6px solid #4874CD";
objFlash.style.zIndex = 301;
objFlash.style.position= "absolute";
objFlash.style.backgroundColor = "#ffffff";
x = '';
x = x + '<table border=0 cellspacing=0 cellpadding=5 width=100%><tr><td align=right>'
x = x + '<a style="cursor: pointer;" onclick="divOff(); return false;">x<b> close</b></a>';
x = x + '<b>&nbsp;&nbsp;&nbsp; </b>';
x = x + '</td></tr></table>';
x = x + '<iframe name=iframe4 id=iframe4 width=600 height=477 frameborder=0 marginheight=8 marginwidth=8 scrolling=auto></iframe>';
objFlash.innerHTML = x;
var arrayPageSize = getPageSize();
var arrayPageScroll = getPageScroll();
// center loadingImage if it exists
if (objFlash)
{
objFlash.style.position = 'absolute'; //???
//   objFlash.style.top = (((arrayPageSize[3] - 35 - 440) / 2) + 'px');
//   objFlash.style.left = (((arrayPageSize[0] - 20 - 600) / 2) + 'px');
//   objFlash.style.width = '600';
//   objFlash.style.height = '500';
objFlash.style.top = (((arrayPageScroll[1]) / 1)+50 + 'px');
objFlash.style.left = (((arrayPageSize[0] - 20 - 600) / 2) + 'px');
objFlash.style.width = '600';
objFlash.style.height = '500';
//   objFlash.style.zIndex = '90';
//   objFlash.style.display = 'block';
}
var start = new Date();
var randomnumber=Math.floor(Math.random()*30000);
xtime = start.getTime();
dummyvar = xtime + randomnumber;
xUrl = "b.php?dummy=" + dummyvar + "&Id=" + aId_task;
document.getElementById('iframe4').src = xUrl;
}
function divOff()
{
document.getElementById("div_popup").innerHTML = "";
//  document.getElementById("divek").display = "";
document.getElementById("divek").style.visibility = "hidden";
xUrl = "";
document.getElementById('iframe4').src = xUrl;
}
</script> 

And b.php will shows some data regarding id.

Now my question is :- How to call this function in a.php file so that it will show b.php as a popup in same window.

Is here any help...

I think you could use GreyBox for this. It doesn't use any frameworks, and allows you to display websites, text and images.

In graybox, i am trying this link. so this link

<?php echo "<a href='#' onclick=window.open('work.php?ID=".$row['Job_id']."','mywindow','menubar=1,resizable=1,width=350,height=250')>".$row['Job_id']."</a>"; ?>

converted in to

<?php echo "<a href='b.php' onclick='return GB_myShow('Google', 'b.php')'>Visit Google without loading</a>";?>

but its not working.

I am not sure whether we can use greybox in php or not.

Is there any help

over here complete link is not printing. So please neglect above reply.

I want to know. How we can use greybox in php. Or apart from greybox. is there any other utility is available.

Thanks !
i got the answer

<?php echo "<a href=\"b.php\" rel=\"gb_page[830, 630]\">B.PHP</a>"; ?>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.