SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Drop Down list and redirection HELP!!

    I want to make a drop down list that everytime i select a value that causes the execution of a php code!

    Is that practicable?

  2. #2
    SitePoint Wizard aaron.martone's Avatar
    Join Date
    Feb 2003
    Location
    Florida, USA
    Posts
    2,322
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Well, I know nothing of PHP, but in ASP, you would just do the following.
    Code:
    <select name="changer" size="1">
    <option value="?action="1">Do this</option>
    <option value="?action="2">Do this</option>
    <option value="?action="3">Do this</option>
    </select>
    And then you would just code some javascript to goto the current page + the value of this select box.

    So if this was on page.asp (or php), it would goto page.asp?action=2 or what have you. Then in your page, you'd have it check the querystring for any action values. If they are present, and depending on the value, it runs the PHP code you want.

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Anywhere
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is that auto-redirecting script?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •