`Yousef Posted August 22, 2009 Share Posted August 22, 2009 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 More sharing options...
Aravinthan Posted August 22, 2009 Share Posted August 22, 2009 I think you can have the same values, not sure thou. Just run it to see if it works. Link to comment https://forums.phpfreaks.com/topic/171399-option-forms-help-needed/#findComment-903923 Share on other sites More sharing options...
`Yousef Posted August 22, 2009 Author Share Posted August 22, 2009 Yeah you can have the same values but I want to know if you can add a second value or something that I could use in my PHP landing page rotator to differentiate between the two options that have the value 18. Link to comment https://forums.phpfreaks.com/topic/171399-option-forms-help-needed/#findComment-903948 Share on other sites More sharing options...
PFMaBiSmAd Posted August 22, 2009 Share Posted August 22, 2009 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']); Link to comment https://forums.phpfreaks.com/topic/171399-option-forms-help-needed/#findComment-903950 Share on other sites More sharing options...
`Yousef Posted August 22, 2009 Author Share Posted August 22, 2009 Ah right, so $value1 would be used in the &fmt='$value1' and then the landing page/ad rotator would be decided base on $value2 for example? Link to comment https://forums.phpfreaks.com/topic/171399-option-forms-help-needed/#findComment-903965 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.