Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 4 of 4

Thread: DHTML Help

  1. #1
    Join Date
    Apr 2005
    Location
    Manchester
    Posts
    1,046
    Tokens
    0

    Latest Awards:

    Default DHTML Help

    Hi, I need help with some drop-down menus. I want to create a specified search using selections made from the drop down menus. How do i link what it is selected to my data which will just select the desired information.
    Thanks
    Sometimes..
    All you have..
    Is 24 Hours....


    The End...
    Is where we Start from...

  2. #2
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    Can you make it abit more specific please.. do you mean if you click on a drop down link you want it to be searched for or what?

  3. #3
    Join Date
    Nov 2005
    Posts
    807
    Tokens
    1,335

    Latest Awards:

    Default

    Quote Originally Posted by Splinter
    Can you make it abit more specific please.. do you mean if you click on a drop down link you want it to be searched for or what?
    EDIT: I think I understand you now.. well I would place your search query's into an array and then query them.. ill take it that your using a mysql database ..

    PHP Code:
    <html>
    <head>
    </head>
    <body>
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    Search: <select name="query1"><option>Name</option></select>
    <select name="query2"><option>Type</option></select>
    <select name="query3"><option>Colour</option></select>
    <select name="query4"><option>Time</option></select>
    <input type="submit" value="Search" name="search" />
    </body>
    </html>
    <?php
    if(isset($_POST['search'])) {
    $query1 $_POST['query1'];
    $query2 $_POST['query2'];
    $query3 $_POST['query3'];
    $query4 $_POST['query4'];
    $array($query1$query2$query3$query4);
    foreach (
    $array as $query) {
    $search mysql_query("SELECT * FROM database WHERE info LIKE '%$query%'");
    }
    $count mysql_num_rows($search);
    echo 
    "We have found<b>$count</b> matches to your search!<br />!";
    while(
    $row mysql_fetch_array($search)) {
    echo 
    "Put your results here..";
    }
    }
    ?>
    Oops.. meant to edit my old post must have quoted..
    Last edited by Splinter; 24-02-2006 at 04:27 PM.

  4. #4
    Join Date
    Apr 2005
    Location
    Manchester
    Posts
    1,046
    Tokens
    0

    Latest Awards:

    Default

    Arrrr thats great thanks. How do align the search button and drop down menus?
    Sometimes..
    All you have..
    Is 24 Hours....


    The End...
    Is where we Start from...

Posting Permissions

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