Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old September 15th, 2005, 04:06 AM
jsinteractive jsinteractive is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 8 jsinteractive User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help for JavaScript with PHP

I have some PHP code that retrieves text information and image information from a database including 3 thumbnails and a larger image. The

JavaScript usually works for me and triggers an image change when you click one of the thumbnails. It works fine on this site:

www.ercrosscountry.com/east-jordan.php , but I am having problems with the code when i am trying to use it with this database version below. I

have tried numerous ways to get this to work, but I cannot figure it out....please help.


php Code:
Original - php Code
  1.  
  2.  
  3. <script type="text/javascript" language="JavaScript">//Java to reveal the larger image on click
  4. function changeImage(filename, description, size)
  5. {
  6. document.mainimage.src = filename;
  7. document.all("description").innerText = description;
  8. document.all("size").innerText = size;
  9. }
  10. </script>
  11.  
  12.  
  13. </head>
  14.  
  15.  
  16. <!--------------more page code here--------------------------//-->
  17.  
  18.  
  19. <table width="100%"  border="0" cellspacing="2" cellpadding="2">
  20.   <?php do { ?>
  21.   <tr valign="top">
  22.       <td width="51%"><h1>&nbsp;<?php echo ucfirst($row_Project_list['project']); ?></h1>          <p><?php echo $row_Project_list['description'];
  23.  
  24. ?></p>          <p>&nbsp;</p></td>    
  25.       
  26.       <td width="49%"><p><img src="<?php echo $imagelarge.$row_Project_list['image1'];?>" alt="Elmer's Projects" name="mainimage" width="340"
  27.  
  28. height="240" style="background-color: #CCCCCC"></p>
  29.      <?php
  30.      {
  31.      echo
  32.      '<a href="javascript:changeImage(''.$imagelarge.$row_Project  _list['image1'].'')"><img src="'. $imagethumb.$row_Project_list['image1'].'"
  33. alt="" width="109" class="image-one2" style="background-color: #0099FF"></a>';
  34.       
  35.      echo
  36.      '<a href="javascript:changeImage(''.$imagelarge.$row_Project  _list['image2'].'')"><img src="'. $imagethumb.$row_Project_list['image2'].'"
  37. alt="" width="109" class="image-one2" style="background-color: #0099FF"></a>';
  38.     
  39.          echo
  40.      '<a href="javascript:changeImage(''.$imagelarge.$row_Project  _list['image3'].'')"><img src="'. $imagethumb.$row_Project_list['image3'].'"
  41. alt="" width="109" class="image-one2" style="background-color: #0099FF"></a>';
  42.      }
  43.      ?>
  44.     
  45.         <p></p></td>
  46.   </tr>
  47.   <?php } while ($row_Project_list = mysql_fetch_assoc($Project_list)); ?>
  48. </table>
  49.  
  50. <?php
  51. mysql_free_result($Project_list);
  52. ?>
  53.  

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Help for JavaScript with PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway