Jump to content

A popuo window?


rameshfaj

Recommended Posts

I have displayed the photo of an item in the webpage.The database (mysql server)stores the information like itemid,itemname,itempircture,itemdescription etc in mysql table.In the web page(PHP)I have displayed only the name,id and photo of the item.Now what I need is when the user clicks on the item's image,a popup window should be generated that contains all the information about the item ,taken from the database.

Can u provide the code,please.

Link to comment
https://forums.phpfreaks.com/topic/40317-a-popuo-window/
Share on other sites

Here is the javascript for the popup. You would make the image on the first page a link like so:

echo '<a href="javascript:void(0);" onclick="myPopup(\'' . $itemid . '\')"><img></a>';

 

The javascript function would look like this:

function myPopup(id) {
window.open("secondPage.php?itemid="+id, "myWindow", "status = 0, scrollbars = 1, height = "+screen.height+", width = "+screen.width+", resizable = 1" )
}

 

Now all you have to do is make a similar copy of your first php page and name it secondPage.php. On that page you should put how you want the popup to look. Hope this helps!

 

Michael

Link to comment
https://forums.phpfreaks.com/topic/40317-a-popuo-window/#findComment-203316
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.