Jump to content

Php with drop downboxes


Liamsorsby

Recommended Posts

  • 2 weeks later...

this is simply my idea....

 

first create two different html/php pages

one that will be the list for your users to utilize the drop downs

next one that will have the redirect information.

 

first page that will be for your users aka htmlSelection.php

<html>

<body>
                        <form action="dropdownResults.php" method="POST" name="links">
                                <select name="dropdown" value="options">
                                        <option value"htmlSelection.php">Select Format</option>
                                        <option value="directory/yourTitle1.php">Your Title 1</option>
                                        <option value="directory/yourTitle2.php">Your Title 2</option>
                                </select>

                                <br/>
                                <br/>

                        <input type="submit" value="Submit Query"/>


</body>
</html>

 

 

second page that will be for your redirect aka... dropdownResults.php

<?php

$drop = $_REQUEST['dropdown'];

if ($drop ='Your Title 1')
header("Location: yourTitle1.php".$row["your Title 1"]);

elseif ($drop ='Your Title 2')
header("Location: yourTitle2.php".$row["Your Title 2"]);

?>

 

 

now what you want to do is place your mysql code at the top of "Your Title 1 or 2" .php files that connects/queries/closes the mysql db.

read here... http://www.w3schools.com/PHP/php_mysql_connect.asp

Archived

This topic is now archived and is closed to further replies.

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