rameshfaj Posted February 27, 2007 Share Posted February 27, 2007 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. Quote Link to comment Share on other sites More sharing options...
fenway Posted February 27, 2007 Share Posted February 27, 2007 Simply have the pop-up window call a second php script. Quote Link to comment Share on other sites More sharing options...
rameshfaj Posted March 4, 2007 Author Share Posted March 4, 2007 Can u show me the code in reference to PHP or JSP? Quote Link to comment Share on other sites More sharing options...
fenway Posted March 4, 2007 Share Posted March 4, 2007 Well, you must be passing the picture ID to this pop-up window. Quote Link to comment Share on other sites More sharing options...
rameshfaj Posted March 9, 2007 Author Share Posted March 9, 2007 I need some codes man! www.jobspokhara.com.np problem Quote Link to comment Share on other sites More sharing options...
ldsmike88 Posted March 9, 2007 Share Posted March 9, 2007 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.