Jul 25, 2008

Multiple Drop Down Lists ? - Multiple drop down lists to take user to new page

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Multiple Drop Down Lists ? - Multiple drop down lists to take user to new page

claireb85
Hi everyone

I was wondering if anyone could help.

I want to create a page with multiple drop down lists and depending what the user selects decides the page they will be taken to. Sorry i havent explained this too well.

Here is an example of what i want (link below) the user is also emailed a copy

http://www.dermalogica.com/SpeedMappingOnl...US&region=B

I have searched the web and come close but nothing does it right

I would be extremely greatful if anyone could help!

Thanks

Reply

jlhaslip
He is a script which works with dates and pull-downs.
If you have some php skill, you might be able to re-work it to generate the anchor tags for your site.
CODE
<?php # Script 3.12 - dateform.php (2nd version after Script 3.7)
$page_title = 'Calendar Form';


// This function makes three pull-down menus for the months, days, and years.
function make_calendar_pulldowns($m = NULL, $d = NULL, $y = NULL) {

// Make the months array.
$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');

// Make the months pull-down menu.
echo '<select name="month">';
foreach ($months as $key => $value) {
echo "<option value=\"$key\"";
if ($key == $m) { // Preselect.
echo ' selected="selected"';
}
echo ">$value</option>\n";
}
echo '</select>';

// Make the days pull-down menu.
echo '<select name="day">';
for ($day = 1; $day <= 31; $day++) {
echo "<option value=\"$day\"";
if ($day == $d) { // Preselect.
echo ' selected="selected"';
}
echo ">$day</option>\n";
}
echo '</select>';

// Make the years pull-down menu.
echo '<select name="year">';
for ($year = 2005; $year <= 2015; $year++) {
echo "<option value=\"$year\"";
if ($year == $y) { // Preselect.
echo ' selected="selected"';
}
echo ">$year</option>\n";
}
echo '</select>';

} // End of the function definition.

// Create the form tags.
echo '<h1 id="mainhead">Select a Date:</h1>
<p><br /></p><form action="dateform.php" method="post">';

// Get today's information and call the function.
$dates = getdate();
make_calendar_pulldowns ($dates['mon'], $dates['mday'], $dates['year']);

echo '</form><p><br /></p>'; // End of form.

// Print the current day and time.
echo '<p>Today is ' . date ('l') . '. The current time is ' . date ('g:i a') . '.</p>';


?>

I didn't write this script, but I can assist with modding it if you need some help. Post back here if required.

 

 

 


Reply

Saint_Michael
Or if you don't want to go to the php route and want to stick with a CSS/html menu then go to http://www.cssplay.co.uk/menus/index.html since they got a nice list of multiple drop down menu's and of course other types of drop down menus;

Reply

jlhaslip
SM,
check the referenced link in the opening post.
They need input selects rather than a drop-down menu. Definately a php solution (or ASP).

Reply

claireb85
Hey jlhaslip thank u so much for your reply. I have a basic php knowledge but dont really understand what this code does what is supposed to happen when i select from the different drop downs. I would be really greatful if you could help me with this

Thanks again

QUOTE(jlhaslip @ Aug 29 2007, 05:33 PM) *
He is a script which works with dates and pull-downs.
If you have some php skill, you might be able to re-work it to generate the anchor tags for your site.
CODE
<?php # Script 3.12 - dateform.php (2nd version after Script 3.7)
$page_title = 'Calendar Form';
// This function makes three pull-down menus for the months, days, and years.
function make_calendar_pulldowns($m = NULL, $d = NULL, $y = NULL) {

// Make the months array.
$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');

// Make the months pull-down menu.
echo '<select name="month">';
foreach ($months as $key => $value) {
echo "<option value=\"$key\"";
if ($key == $m) { // Preselect.
echo ' selected="selected"';
}
echo ">$value</option>\n";
}
echo '</select>';

// Make the days pull-down menu.
echo '<select name="day">';
for ($day = 1; $day <= 31; $day++) {
echo "<option value=\"$day\"";
if ($day == $d) { // Preselect.
echo ' selected="selected"';
}
echo ">$day</option>\n";
}
echo '</select>';

// Make the years pull-down menu.
echo '<select name="year">';
for ($year = 2005; $year <= 2015; $year++) {
echo "<option value=\"$year\"";
if ($year == $y) { // Preselect.
echo ' selected="selected"';
}
echo ">$year</option>\n";
}
echo '</select>';

} // End of the function definition.

// Create the form tags.
echo '<h1 id="mainhead">Select a Date:</h1>
<p><br /></p><form action="dateform.php" method="post">';

// Get today's information and call the function.
$dates = getdate();
make_calendar_pulldowns ($dates['mon'], $dates['mday'], $dates['year']);

echo '</form><p><br /></p>'; // End of form.

// Print the current day and time.
echo '<p>Today is ' . date ('l') . '. The current time is ' . date ('g:i a') . '.</p>';
?>

I didn't write this script, but I can assist with modding it if you need some help. Post back here if required.


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : multiple lists multiple lists user

  1. Evilboard (forum Software) - Multiple Categorys - Don't Work :( - I am creating a forum and i can't fix more then 1 category. (6)
    I am at the moment trying to program my own forum, but i need more then a single category, here is
    my source: CODE function cat () { include("functions/functions.php");
    echo '<table width="100%"  border="0" cellspacing="0">
    <tr> <td class="eb_top" colspan="3" style="border-bottom-width:
    0; height: 30px; font-size: 12px;"> <b>Forum</b></td>
    </tr>';      global $catid;   $db = new db;   $db->connec...
  2. Unexpected T_string In User.php [resolved] - (5)
  3. Php Ftp Upload Form - Adding User Directory to PHP Upload Form - Help (0)
    Alright I am trying to have a PHP FTP Upload Form that allows the user to create the directory
    folder for where they want to upload there files to. example: Main Directory: vainsoft.com There
    directory: vainsoft.com/modeling or vainsoft.com/photography But I dont want them to be able to
    upload things into the main directory, only sub-directories, is that possible with this coding that
    I have: //uses $_FILES global array //see manual for older PHP version info //This
    function will be used to get the extension from the filename function get_extension($fi...
  4. Script That Tracks The User Status - how can I track on or offline users? (4)
    long explaination: hey, I'm building a user profile site right now. And, I kinda know how to
    make a online/offline detector, but not totally sure. I know I can make a mysql database to track
    them, but how does it entrer the information? I could easily put in a field where when they login it
    sets them to online, but if they don't sign out, and just exit the browser, how can I tell.
    short: I want someone to tell me how to make a online/offline status detector, like they have here
    on trap17. I'd be thrilled if you can post to this, thanks, arcticsnpr...
  5. [mysql]get Id Of Loged In User? - (7)
    how to get the id number of the loged in user? my db is id. username. password. i have tryed a
    few things.. but i never seem to get it right /ohmy.gif" style="vertical-align:middle" emoid=":o"
    border="0" alt="ohmy.gif" />...
  6. Compare 2 List Of User Ids From Different Tables - (1)
    Hi all. I am trying to make a list out of 2 list. The first list is a complete list of users id
    from users table (List A) The Second list is of users id from another table (List /cool.gif"
    style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> I want to subtrack the user
    ids in List B from List A and make List C. Thanks in advance for any help /smile.gif"
    style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Update: I looked up a old
    sql book i had and found some query examples. I tried the EXCEPT statement in mysql but it dont wor...
  7. Using Multiple Selection Array In Table To Order Data - Using multiple selection array in table to order data (1)
    have a form that has a multiple select choice, like this: CODE <form method="post"
    action="display.php" <select multiple name="selectsort[]">
    <option value="code">Code</option> <option
    value="amount">Amount</option> <option value="dateammended">Date
    Ammended</option> <option value="expreviewdate">Expiration/Review
    Date</option> <option value="effectivedate">Effective Date</option>
    <option value="e...
  8. Directing To A User To Specific Page First Time Only - (3)
    I make a signup page. I want that when someone signups and login for first time..then he is directed
    to the page X automatically. but after that it is redirected to Page Y always... Its pretty simple
    thing to do but im not understanding how i can make the script to identify that a person has logged
    in for first time ... anyhelp would be so welcome. Thanks....
  9. Password Strength / User Availablity Scripts ? - (2)
    many of u guys would already have noticed that now a days , on most of the websites , when some one
    sign in...as he puts his desired username in the textbox , the page shows that it is not available
    or it is available...without pushing any button etc.. and the second thing , when some one writes
    the password , on the same screen , it shows that password is weak or password is strong... i think
    it is done with php ... can some one give me a link to any page where i can access these scripts ?
    or some one can help me regarding this ?? Thanks for helping always....
  10. Multiple Options? - (3)
    Okay so what Im trying to figure out is how I would go about giving the people to uh, well for
    examplkes sake it would be like "how many cats do you have" then theyd fill in a number, submit and
    the next page would print out boxes for as many cats they have that will be too fill in a color of
    the cat, so basically something like that, where it will only give them so many fields based on how
    many they said they have, and then their final "reciept" will only print out stuff for as many as
    they filled itn ...
  11. Cleaning User Input With Regex - (1)
    As anyone who works with user input knows, not everyone who submits information makes it look
    proper. One one of my web forms, I parse all the needed fields that I wish to be title cased; their
    name, address, city, etc. I use this to perform this action, which works nicely: PHP Code: CODE
    $string = ucwords(strtolower($string)); This fixes the input if
    the user types in all caps or all lowercase. There is a problem I have been noticing about those who
    enter a generation after their name, such as "Bill Warner III". The above functio...
  12. How Handle Sending Back Multiple Checkboxes - (1)
    I know how to send back the check-boxes, so that's not the issue. I have a form that contains a
    group of 5 check-boxes. The user could select none, one, all, or any combination in between.
    I'm working on form validation right now and am doing most of it server side. The validation is
    set so that if the user has to go back all their data is retained. I'm using case statements,
    which work wonderfully, but in this circumstance I don't know what would be the best method that
    allows for a multitude of combinations. I think there is a possibility of somethi...
  13. Drop Down Lists Using Dates - (5)
    Hi, I have a page where the user enters a date. I would like to use drop down boxes for the date.
    I would like the current date to be the default date. I think that part is pretty easy. However,
    I am having trouble listing all of the months. It wills tart at July and end at December. I need
    to list January through June. Anyone know a good way to list all the months? I am assuming that
    I will be able to do the same sort of thing for the date. Thanks!...
  14. User Login System With Setcookies - (13)
    a friend of mine is quite good at php and told me not to use sessions and to use setcookie im not
    sure how to use setcookie to make a user authentication system and was wondering if anyone here know
    a tutorial on how to do it...
  15. Php Classes - Access the same class instance over multiple pages (1)
    Hey everyone. I am having some trouble accessing the same php class instance in more that one page.
    This is for my login script and what i need to do is be able to call the classes logout function
    from a separate page. What i have tried to do is create a new .php page and include the class file
    and then make a new class and call logout. This does not work because it does not log out the
    current user which is my problem. Can anyone help me fix this or know of another way to do it?
    Below is my class file CODE <?php     // member class     // handlers member logo...
  16. Php Login Script - Removing the login field once the user logs in (18)
    Hey everyone. I have a login script that i know works. My question is that on my main page, it have
    a form to allow the user to log in. What i want it to do is that once the user logs in, the form
    disappears and the users data (aka username) is displayed where the form was. At the moment i cant
    get it to work. Below is my code. CODE <div id="loginMenu">  <?php    if
    ($logged_in == 1)    {  ?>     <!-- User information -->  <?php
        }//if     else     {  ?>     <form action="<?php echo &...
  17. Php Sessions - Multiple users using the same login (2)
    Hi, I'm realtively new to PHP and I'm considering creating some login functionality.
    However I want a group of users to use the same loginname and password. They will be loggin infrom
    different machines. The users will know they are sharing the account. Can anyone give me an idea
    of what kind of effect this might have on my sessions? Will it create any odd hiccups or other
    strange things?...
  18. Create A Windows User Account - (1)
    hi, i am making an online registration scheme for my website for some webspace. i have got every
    thing sorted out exsept for one thing. to acces the ftp service and upload files to there user space
    i need to create a user account on the server for that user. is there a way to create a user account
    on a windows operating system with php 5 installed. thanks, kvarnerexpress ...
  19. User Log-in - PHP question (2)
    Hello all, I am a PHP n00b. I have read the Login page post, which is over my head. I was hoping
    someone could explain a concept to me more in layman's terms. This is what I hope to do - I want
    to go to my url (www.xyzblah.com) and have it automatically prompt for either a username and
    password, or just a password. After the correct credentials are supplied, go to the regular
    index.html. Any help you could give me is appreciated. Thanks....



Looking for multiple, drop, lists, multiple, drop, lists, user, page

Searching Video's for multiple, drop, lists, multiple, drop, lists, user, page
advertisement



Multiple Drop Down Lists ? - Multiple drop down lists to take user to new page



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE