473,324 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Onclick image displayed from DB

Dear people,
I created a postgresDB with maps(.jpg) and additonal information about them such as "area,theme,type,language,date,creator,...etc"
I created a form with 4 drop-down options for "area,theme,type,language" and a "submit" button.After a query you can receive a table of results with the maps in small size and some of the additional information(not all).


QUESTION

I want to click on one of the the displayed images(map), open it in a new page enlarged and with all the rest aditional information from the database. I tried it with <a href=$imageurl> but only i can do is to enlarge the image without putting the information See bellow the resultpage.php code, at the "echo" part.

Does anybody knows how i can solve that?

Thanks all for your time and help.

Expand|Select|Wrap|Line Numbers
  1. while($row =pg_fetch_array($result, null, PGSQL_ASSOC))
  2.   {
  3.  
  4.       echo "<tr>";
  5.       echo "<td align='center'>" . $row['title'] . "</td>";
  6.       echo "<td align='center'>" . $row['area_name'] . "</td>";
  7.       echo "<td align='center'>" . $row['type_name'] . "</td>";
  8.       echo "<td align='center'>" . $row['theme_name'] . "</td>";
  9.       echo "<td align='center'>" . $row['language_name'] . "</td>";
  10.       echo "<td align='center' > <a href=$row[link]>" . $row['link'] . "</a>         </td>";
  11.     $imagebytes = $row['name'];
  12.     $imagebytes = trim($imagebytes);
  13.     $imageurl='http://localhost/IMPCHEN/' . $imagebytes . ".jpg";
  14.      echo "<td align='center'> <a href=$imageurl> <img  src=$imageurl    width='157' height='117'>" . $row['name'] . "</a> </td>";
  15.  
  16.  
  17.       echo "</tr>";
  18.   }
  19. echo "</table>";
  20. // onclick=myfunc(obj)
  21. pg_close($con);
  22. ?>
  23.  
May 10 '11 #1
1 2085
nathj
938 Expert 512MB
Hi,

If I understand correctly then you could use something like fancyboxto help you out here. Then with this jQuery plugin you can write the appropriate links for your image such as:
Expand|Select|Wrap|Line Numbers
  1.     <a class="example_group" rel="group1" href="http://bytes.com/topic/images/1_b.jpg" title="We've had our sunny days"><img alt="" src="http://bytes.com/topic/images/1_s.jpg" /></a>
  2.  
The bigger image goes first and the smaller image is the one initially displayed.

Reading on Fancybox you can use html in the captions under the images allowing you to display that extra information pretty much however you like.

Does this help with the problem you are facing?

The other option I can see is that the click of the image needs to call to some php to run a more specific query that returns more of the data. This could be done using AJAX

There is a balance here between getting all of the dat up front and making more http requests to get the extra data later on. I would suggest in this case that getting it all upfront is best - reducing the number of requests.

Hope this helps
nathj
May 12 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Roger | last post by:
I am trying to capture the image coordinates when a user clicks on an image. My code is working in Firefox, Mozilla, Netscape, IE, and Opera, but fails under Konqueror (and I suspect Safari). ...
6
by: ruca | last post by:
Hi gurus, I have a imagebutton in my WebForm, and I want that when I click (mouse down) on her the imagebutton change image and when I "unclick" (mouse up) change to the original image. Basically...
2
by: Fabio Negri Cicotti [MCP] | last post by:
Hi all. How do I do to display a picture on e-mail's body when visualized using Outlook Express? I've set the properties bellow but till now I've got the image shown as that box with a red...
1
by: blumoosie | last post by:
I have the following code: //This is at the top before the </head> tag <script> goLocations = new Array( "#", "first_option.doc", "second_option.doc", "#" ); </script>
2
by: webdeveloper | last post by:
sorry about that, This is the event handling element: <div id="menu"> <ul> <li>.... <li><a href="javascript:expand_menu(document.getElementById('extend'))" id="extend">Text <img src=""...
2
by: mukeshrasm | last post by:
Hi I am printing some text on image dynamically. I am setting the font size and type dynamically and then displaying to other page. Thing is that it is not displaying the image when I click submit...
5
by: aewhale | last post by:
I am putting together a website for my company's Email Security tool, SpamZapper. The problem is that the webpage on http://www.spamzapper.us/features It displays correctly with Firefox. However...
0
by: Lou O | last post by:
I have browsed and seen several posts on the subject but my issue seems to be unique. I have an image control on a form that updates on the after update event of a list box on the control. For...
11
by: NDayave | last post by:
How Do, I am using custom message boxes to make them much more aesthetically pleasing. On this form, there are 4 images for "Question", "Information", "Critical" and "Exclamation". I found the...
4
by: amritpalpathak | last post by:
This is the html file <html> <body> <body onload="changeIt();"> <head> <script langauge="javascript"> function changeIt() { var width=50;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.