Jump to content

Option Forms Help Needed


`Yousef

Recommended Posts

Alright, this isn't really PHP I guess but it will integrate with my PHP script so :).

 

I was wondering if a drop-down menu can have two values for each option, for example:

 

<select name="type">
<option value="18">PSP</option>
<option value="18">iPOD</option>
<option value="5">FLV</option>
</select> 

 

This is for my YouTube to PSP/iPOD whatever script. It uses the numeric value and adds it to the YouTube URL in the format &fmt=value which codes as

 

"http://www.youtube.com/get_video?video_id=".$var_id."&t=".$var_t."&fmt=".$_POST['type'];

 

However I want to add a second value or something that would allow me to rotate certain things on the landing page in order to make it a more targetted experience for them.

 

Anyway I can go about doing this? Any help greatly appreciated :).

 

Link to comment
https://forums.phpfreaks.com/topic/171399-option-forms-help-needed/
Share on other sites

You can put any string in as the value attribute. A common method is to concatenate using a separator character, like |, and then explode the data on that separator character to retreive each piece.

 

value= "18|abc"

 

list($value1,$value2) = explode("|",$_POST['type']);

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.