Anyone can help in a little issue ?

Discussion in 'PHP' started by best_services, Dec 8, 2011.

  1. #1
    Hello,

    I am encountering a problem and trying to find the best solution .

    I have to <select> tags

    <select name='type'>
    <option value='mini'>Mini Ad</option>
    <option value='more'>More Ad</option>
    </select>

    <select name='cred'>
    <option value='1'>1000 cred</option>
    <option value='2'>2000 cred</option>
    </span>

    and a <a type="text" id="others"> </a>

    What i want is for first select if a option from those 2 is selected to store a value in a variable , same as the 2nd . Something like if mini is selected up $t = 0.01 and then if option 1 is selected a second variable $d to be stored so i can show them in <a> tag and they will be changed instantly if they select another option .

    I am opened to suggestions, Thanks
     
    best_services, Dec 8, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    HTML doesn't have variables. If you want to store things in the client (the user's browser - which only lasts until they go to another page) use a Javascript variable. If you want to store things on the server use a variable in whatever language your server-side code is written in - PHP, ASP, etc.

    Tell us what you're doing and someone can write some code for you.
     
    Rukbat, Dec 10, 2011 IP