Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.


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
    Last edited by lucidsurf; March 9th, 2005 at 07:57 AM.

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


Copyright 1999 - 2012