You are viewing our Forum Archives. To view or take place in current topics click here.
Hello - i need help with this dropdown menu thing[php][html]
Posted:

Hello - i need help with this dropdown menu thing[php][html]Posted:

AndrewHuby
  • New Member
Status: Offline
Joined: Mar 13, 201311Year Member
Posts: 41
Reputation Power: 1
Status: Offline
Joined: Mar 13, 201311Year Member
Posts: 41
Reputation Power: 1
Im trying to make this dropdown enter a value into a url then get that value from the url and if it = something then do the relevant thing but i cant seem to get it to work

<html>
<head>
   <title>
      Home-page
   </title>
</head>
<body>
   

   
       <select  onchange=')'>
            <option value="North" href="?dir=Noth"> <a href="?dir=North">North</a></option>
            <option value="Central">Central</option>
            <option value="East" href="?dir=East"><a href="?dir=East">East</option>
        </select>
     
     <?php
     if(isset($_GET['East'])){
        echo "hello";
     }
    ?>
</body>
</html>
that is what i have got so far
#2. Posted:
LAXDUDE182
  • Challenger
Status: Offline
Joined: Jun 25, 201113Year Member
Posts: 163
Reputation Power: 6
Status: Offline
Joined: Jun 25, 201113Year Member
Posts: 163
Reputation Power: 6
Change your php to this:

if(isset($_GET['dir'])){
   echo "hello";
}

You need to check the variable name, not the value.
#3. Posted:
AndrewHuby
  • New Member
Status: Offline
Joined: Mar 13, 201311Year Member
Posts: 41
Reputation Power: 1
Status: Offline
Joined: Mar 13, 201311Year Member
Posts: 41
Reputation Power: 1
LAXDUDE182 wrote Change your php to this:

if(isset($_GET['dir'])){
   echo "hello";
}

You need to check the variable name, not the value.

Okay so how would i check if it is = to a name
#4. Posted:
AndrewHuby
  • New Member
Status: Offline
Joined: Mar 13, 201311Year Member
Posts: 41
Reputation Power: 1
Status: Offline
Joined: Mar 13, 201311Year Member
Posts: 41
Reputation Power: 1
AndrewHuby wrote
LAXDUDE182 wrote Change your php to this:

if(isset($_GET['dir'])){
   echo "hello";
}

You need to check the variable name, not the value.

Okay so how would i check if it is = to a name
and that code till deosn't work
#5. Posted:
LAXDUDE182
  • Challenger
Status: Offline
Joined: Jun 25, 201113Year Member
Posts: 163
Reputation Power: 6
Status: Offline
Joined: Jun 25, 201113Year Member
Posts: 163
Reputation Power: 6
Go sign up at [ Register or Signin to view external links. ] and take this course: [ Register or Signin to view external links. ]
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.