phrozenflame Posted January 1, 2007 Share Posted January 1, 2007 i am working on designing a webpage. I give a list of options for the user to choose from and then once the user has choosen what they want the products avaliable on the option are displayed. The code i have used is: foreach($food_categories as $key => $subarray) { echo "<h3>$key</h3>"; echo "<ul>"; foreach($subarray as $type) { echo "<input type='radio' name='interest' value='$type'>$type\n"; } echo "</ul>"; }Instead of having the list like this i want the user to be able to choose from a set of pictures. I have stored pictures in my database under the heading "pic". Now how do i change my code to enable me to display pictures which the user can select rather than a list??? Thanks Link to comment https://forums.phpfreaks.com/topic/32439-how-to-add-images-as-links/ Share on other sites More sharing options...
wildteen88 Posted January 1, 2007 Share Posted January 1, 2007 the echo in the for each loop. Which is this:[code]cho "<input type='radio' name='interest' value='$type'>$type\n";[/code]What variable holds your image? Link to comment https://forums.phpfreaks.com/topic/32439-how-to-add-images-as-links/#findComment-150751 Share on other sites More sharing options...
Daniel0 Posted January 2, 2007 Share Posted January 2, 2007 [quote author=phrozenflame link=topic=120550.msg494574#msg494574 date=1167643073]I have stored pictures in my database under the heading "pic".[/quote]Do you store the filename/path or do you store the actual image? Link to comment https://forums.phpfreaks.com/topic/32439-how-to-add-images-as-links/#findComment-151577 Share on other sites More sharing options...
DeathStar Posted January 2, 2007 Share Posted January 2, 2007 why not make an image like display like this[code]<a hred='http://thelink.com'><img scr='{$ir['pic']}></a>[/code] Link to comment https://forums.phpfreaks.com/topic/32439-how-to-add-images-as-links/#findComment-151580 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.