The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 2 of 2

Thread: banners module getting very tedious...

  1. #1

    banners module getting very tedious...

    Ok so we all know how to load an image that is in a mysql db:

    echo "<img src=\"showimagescript.php?id=".$id."\" border =\"0\">";

    ..for example.

    BUT, what if I want that image to link to something???? The thing is, in my script I am not passing over the id variable (like in the above example) cause the query I do it on the imageshowscript, for a variety of reasons... so how do I get a value back from the imageshow script back to the page that shows the banner? am I making sense? Cause as far as I know the only thing I can do on the imageshow script is print the header (mime type) and the contents of the image, and thats how it is shown, but is there a way to make those contents a link?? Thank you for all your suggestions

  2. #2
    Hi there,

    I'd probably insert another Field called "URL" into the same table of your MySQL database. Then you can type the relevant link URL into that field for each record. Next up you may need to modify your SQL query accordingly so that you get the Link as well as the image data out of MySQL (or if you're already doing a SELECT * then you have no worries).

    The echo syntax would subsequently look like this:

    echo "<a href=\"".$url."\" rel="nofollow" target="_blank"><img src=\"showimagescript.php?id=".$id."\" border =\"0\"></a>";

    Hope that makes sense I have not used the showimagescript so am not sure of exact specifics but this would be a way of doing it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012