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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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