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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.