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
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']);

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.