Jump to content


Photo

How to add pictures as the links


  • Please log in to reply
1 reply to this topic

#1 OriginalSunny

OriginalSunny
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts

Posted 28 February 2006 - 11:40 AM

Hi,

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'><b>$type</b><br>\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

#2 glenelkins

glenelkins
  • Members
  • PipPipPip
  • Advanced Member
  • 760 posts
  • LocationBridlington - East Riding of Yorkshire - United Kingdom

Posted 28 February 2006 - 12:37 PM

[!--quoteo(post=350181:date=Feb 28 2006, 11:40 AM:name=OriginalSunny)--][div class=\'quotetop\']QUOTE(OriginalSunny @ Feb 28 2006, 11:40 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hi,

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'><b>$type</b><br>\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
[/quote]

foreach($food_catagories as $key => $subarray)
{
     echo "<img src=\"$food_catagories[$key]['pic']\">";

http://thewebsolutionprovider.com - A Solution For Everything Web!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users