View Full Version : scroll box and URI

01-24-2004, 01:56 PM
im having probs

im using dreamweaver4,php4 and mysql.
what i want is to show the url's in the listbox this is what i have show far

<select name="track2edit"size="1"> **********
(2)while ($c_array=mysql_fetch_array($result))
(3) {
(4) $artist= $c_array['totart_names'];
(5) $user= $c_array['spare3'];
(6) $artistlink="<a href=audmp3.php?cart=$artist
(7) print '<option value="'.$user.'">'.$thelink.'</option>';
(8) }
</select> **********

what happens here is

it looks for the artist and user name in the mysql DB
then store them as URI (url) in the $artistlink varible
then show them as a link in the listbox or menubox (scrollable)
then keep doing the whole block again till $c_array is negative

what happens in reality is

it does find all the data and place them in the box
BUT the data appears as normal text instead of a clickable link

so i think in line 6 in the above code is at fault BUT
here comes the big catch

if you remove the lines with the stars (remove the list box) and re-run the code
you will see the the names from the database, once echoed to the screen is now clickable urls.

but i really need in list the box as i want the results of hundreds of artist names in a maintainable scrollable area

i hope you understood my theory


01-24-2004, 03:47 PM
this is a html/forms issue not PHP , you can't stick links like that in a select element, you can put the select box in a <form> and detect onSubmit the selected form item (or add some onclick event to the individual options ?) but again thats not PHP related ... moving to general forum

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum