Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Dynamic Menus


<?php
include('./common_db.inc');
$link_id = db_connect();
mysql_select_db("test_db");

?>

<form name=carform action=
<?php echo $_SERVER['PHP_SELF'];
?> method=post>
<?php


$query =mysql_query("select DISTINCT CQ_PROD_PLATFORM AS make_id from
CQ_data ORDER BY make_id");
echo '<select name=make
onchange="document.carform.submit()"'.">"."
";
if (!isset($make))
{
echo '<option value=null selected>Choose a Make</option>'."
";
}
while(list($make_id) = mysql_fetch_row($query))
{
echo '<option value='.$make_id;
if (isset($make)&& $make_id == $make)
{
echo " selected";
}
echo '>'."$make_id".'</option>'."
";
}
echo '</select>'."
";
echo '<select name=model
onchange="document.carform.submit()"'.">"."
";
if (!isset($make))
{
echo '<option value=null selected>Choose a Make First</option>'."
";
}
else
{
$result = mysql_query("select DISTINCT CQ_SUBSYSTEM AS name from
CQ_data where make_id='$make' ORDER BY NAME");
echo '<option value=null selected>Choose a Model</option>'."
";
while(list($model_id) = mysql_fetch_row($result))
{
echo '<option value=' . $model_id;
if ($model_id == $model)
{
echo " selected";
}
echo '>$model_id</option>'."
";
}
} echo '</select>'."
";
?>




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Dynamic Menus
how to have dynamic menu, say one option is selected from the first menu, and that option changes the 2nd menu options. ?

yeah i have seen it work in JavaScript, (onchange)
but what would the syntax be in php ?

Dynamic Drop-down Menus
I am developing an on-line booking system, and am designing a script which creates a booking "area". An area has the following fields:

Area Name
Day start time (the time of day bookings can begin e.g 9 AM)
Booking Time Slot (the length of time for each time slot e.g 30 mins)
Day Finish Time (the time of day bookings must finish e.g 6 PM)

What i require is a method for locking down the users input so that the finish time is a list that is created that is divisable by the number of minutes used for a booking time slot . e.g. if the start time is 9 am and each booking time slot is 30 minutes, then the user must select a finish time which is divisable by 30 i.e. either on the hour or half past.

I have looked at several methods for doing this but cannot decide what would be suitable.
Ideally I want the user to be able to select the start time from a dropdown (static html would do) the select a booking time slot (again a static html dropdown would surfice) and then a dynamic dropdown be created with a list of Day Finish Times.

My questions are these:

Is this the right way to go about doing this - are drop downs my best option? If so, is calculating the day end time list the best way to go? Would javascript be more suitable, rather than a php form?

Dynamic Pull Down Menus
I was wondering if a kind person off here could point me in the right direction.

I'm making a form on my website so users can request certain information, the thing is, the information they will be requesting will contained in pull down menus, with all the data for the pull down menus in a database. How would i go about changing one set of pull down menus depending on what is selected in a previous menu?

For example, say a user selects "Honda", the next menu would contain all the Honda models in our database, if the user selects something else, they're given more choice again.

Dynamic Menus And Blob Problems
I have a database table with three fields, id, caption and data. I
have used the id and caption to create a dynamic menu. it just throws
it into a loop with extra html formatting stuff. No problem.

The data field is a large blob. The data is a complete html file which
comes out of a timing system for race cars, its basically a big table.

How do I render the blob data within the current window or in a new
window when the link is clicked, its got me stumped. I have used php
to bring the page together using include statements, header footer and
side_nav. the menu gets produced in side_nav.

Dynamic Menus And Blob Problems
I have a database table with three fields, id, caption and data. I have used the id and caption to create a dynamic menu. it just throws it into a loop with extra html formatting stuff. No problem.

The data field is a large blob. The data is a complete html file which comes out of a timing system for race cars, its basically a big table.

How do I render the blob data within the current window or in a new window when the link is clicked, its got me stumped. I have used php to bring the page together using include statements, header footer and side_nav. the menu gets produced in side_nav.

Menus In Php
currently i have web application in php which has its menus created in
javascript.
if we do view source on the page, it displays all the javascript which
is obvious n natural.
but it displays all the file names of php too which are related with
those specific menus.
dont we have any way by which we can prevent it.
as an alternate i m thinking of creating the menus also in php so that
the names of my files dont get visible to the user from the security
point of view.
is it sensible to do so because it will be an extra overhead to the
system for creating the manus everytime.

Drop-down Menus
How can I create drop-down menus in PHP?

Sticky Menus
It's common courtesy to ensure that a form with validation problems reposts with the fields still filled in, so the user doesn't have to start over, by echoing the variables in the Value attribute of the text fields, but I also want to have a drop-down menu to be sticky and retain its selected state when the page reposts.

PHP And Drop Down Menus
I've looked through the forum rather extensively and my qestion is similiar to the question by Brian_F and answer by "saintaw" a couple of days ago in this forum. I already have a functional page that has several dynamic drop-down menus from which the user selects a topic of interest.

My question is how to reference their choice from the drop down menus in order to display the results of their choice. I would like the user to be able to choose a subcategory with one of the drop down menus and then be able to view the questions related to that subcategory.

I currently have a nested for loop which displays the categories and subsequent drop-down menus for each category, and I'm using PHP and MySQL to do the dirty work. code:

Php And Drop Down Menus
I have a question about PHP and drop down menus. Should I be using PHP for my drop down menus or should I be using java script? I have a whole contact form that is programmed in PHP, but I have never done a drop down menu with PHP, is this possible? If anyone knows of any great drop down menu tutorials in PHP.

Selecting Using Pull Down Menus ??
Just wondering how do u create that "ALL" search in php. For example i created a simple pull down menu (category) that has 3 options where each option has an id no. So my select command is " select * from tablename where id = /"id/" and lets say option 1 will have id 1 and so on.

But what i got stuck in was creating an ALL search does n e one know how to do them ?

Dependent Select Menus
I would like to create a form in which a 2nd select box appears
depending on the value selected in the 1st select box. The values of
the 2nd select box will come from a database.

My question is how to create this in php? One way is to re-load the
page depending on what's chosen in the first box, or alternatively to
use frames or an iframe?

Is there another, better way that can dynamically change the initial
page?

Getting Data From Drop Down Menus
I have a drop down menu and I'm trying to find out which option they have pressed.  I need to use the $_POST method to do this. Below is what i've written so far, but it's showing every time the messages:

"You don't have enough points"    AND   "you gained blah blah exp" I've blocked out some of the stuff that calls up files and stuff, just for security reasons Code:

Using PHP And MySQL To Populate (select) Menus
I am a newbie to php *gasp* and I am trying to make a <select> drop down menu, but I want the menus populated by information from a field in my database. There are a bunch of entries in the field MUD, that are identical......I would like the menu NOT to repeat identical names. EX... Each name only once, even though it is in the database many times.

Drop Down Menus And Form Processing
I select a client from the first drop down menu, then a list of events for that client is shown in the second drop down menu. I then want to select the event from the second drop down and automatically go to a form I built "editevent.php3" showing information echoed from mySQL for that event. I have started the code, but know it is not complete. Code:

Insert Date Using Drop Down Menus
I know how to insert a date by filling in a field but I don't know how to do it using a drop down menu. One menu being month, another the day and the last the year. Any code snipplets I can disect and play with or tutorials on this?

Drop Down Menus And Mysql Insertion
I'm looking to create drop down boxes for a user to select the date and then have it insert what they select for month, day, year, hour, minutes and insert it into mysql. It needs to be organized in a timestamp like so: 2007-02-28 21:06:40

I've created the drop down boxes and it works pretty well: Code:

Add Data To A Database Using Dropdown Menus?
lets say i had a database with a table called admin hacks and another table called user hacks,and both tables had feilds called name and id

now what i want to be able to do is create a submit form with a drop down menu saying the table names mentiond above, also the form will have a field called name.

now lets say a user slected admin hacks from the drop down menu and enterd jack in the name, how would i get the data in that submitted form to be inserted into the correct database table, so jack should now be in the table called admin hacks

also lets say someone selected user hacks and entered jon how would i do the same for that?

Connecting Two Database Populated Select Menus
I am able to grab the data from the database to populate the menus individually using.
PHP Code:

Values Into Radio/check And Drop Down Menus
I am attempting to create an update form where the current fields in the table are populated into input boxes and then can be altered where necessary.

I was wondering if it is possible to pre check radio buttons, check boxes and pre populate drop down menus based on the results currently in the table. eg. if the gender of a person is male then the radio button will be pre checked as male. How would this be done.?

Dynamic Nav Bar
I am trying to implement a dynamic navigation bar. My problem is as follows -

All of my scripts are located in various folders, and as you move to different areas of the site, the links to the other areas of the site will change. For example, I am currently at home.php and the nav bar has references to admin/manage_users.php and companies/view_employees.php, etc etc. If I go to manage_users.php, I am now executing a script in the admin folder. The nav bar still has a reference to companies/view_employees.php, which would make this a dead link.

There are lots and lots of directories and subdirectories that one can navigate to, so I don't want to have to write code for a nav bar every time. Is there something like $_SERVER['DOCUMENT_ROOT'] that I can use that will help?

Dynamic Variables In Php?
Hi,
I have a mySQL table that contains two columns
column one is 'feature' and column two is 'feature_value' - some of the data is for example

'hair_color' - 'blue'
'hair_color' - 'blonde'
'hair_color' - 'black'
'hair_color' - 'gray'

'eye_color' - 'blue'
'eye_color' - 'hazel'
'eye_color' - 'brown'

Yeah I know... definitely NOT third normal form. OK here's where it gets even better

On one web page, I build select controls from this data. The name of the control would be the value of the feature column. So from the data above I would have a select control whose name would be name="hair_color" and another select name="eye_color"

NO problems so far.... ok.
Now after the user selects from the selects (get it, sorry).... i am processing the data.

Although I use javascript for some client side validation... I also want to validate in php. (ok, just because I want to ok)

NOW.. the web page form will post these two variables $hair_color' and '$eye_color' as described above. But I don't know ahead of time what these variables are because they're based on data from a table.......

I go the table described above and select distinct on the feature column - I will return two rows.... see below

while($row = mysql_fetch_row($result_set)) {
$feature =trim($row[0]);
}

the value of feature in the first row is 'hair_color' and in the second row 'eye_color'--


What I'd like to do.... is to take the values in the $feature variable and create a literal variable that I can test for that was posted from the form........

so for example in the first row where $feature = 'hair_color' - I want to create a $hair_color variable...... because this is a variable of the select control from the form. Then for the second row where $feature = 'eye_color' - I want to create an $eye_color variable because again... this is the variable of a select control on the form.

Dynamic Links???
I’ve looked at several tutorials and searched the archives of this site. I found a few pointers, but I feel entirely daft and can’t seem to quite get it.

The “ultimate” goal is to display members profiles, and not have to hard code all the bl**dy records, as I’ve done so far. (Current version http://www.internetbonsaiclub.org/c...y/profiles.html)

So, now I have the records in one table in my database. The profiles.php3 page takes all the records in that table, and displays the names in alphabetical order. So far, so good.

Now, I have viewprofile.php3, which should display only one record at a time, based on which name the visitor clicked on.

Dynamic Communication
I am wondering if there is any way to use maybe XML to mimic another sites form on my site. For example, to use maybe Expedia's flight search form on my site and then post the request to expedia and have the results format back into my site. It is sort of the same concept as xml-rpc accept I am wondering if it can be done without setting up an xml-rpc server for the response. Essentially the script would allow you to take the user through the entire search process all the while making it formatted to the layout of your site, but using Expedia's engine.

Dynamic Notification
Is there a way for me to have an email sent to me anytime one of my users creates/uploads a new file in a specific directory on my website? Sorry if this is really basic.... I'm not sure where to start. Any help would be greatly appreciated.

Dynamic Content In A <div>, Using Php
i have a <DIV> block, and I want the innerHTML to change at the click of a button. for those who don't know some javascript, if you have a dive with an id, <DIV id="myDiv"></DIV> you can change the content inside with a function call

myDiv.innerHTML = "some stuff";

however, i need my data to come from a mySQL database and thus needs to be outputted via php. so ideally i want something like

myDiv.innerHTML = "<?php echo "some stuff"; ?>";

of course that does not work because php is not client side, this is just to illustrate what i want. any ideas on how to do this without iframes?

Dynamic Data
I have included a php script into my page
as <img src="plot.php">. That script just plot some time changing data. Now I have two questions that I cannot solve myself:

(1) When I press the reload button I expected
the plot reflected the changed data.
Instead of that plot remains unchanged
until I directly invoke the php script
from the browser...
Is there any method to avoid this
unwanted caching?

(2) That is a bit off topic but is there
any easy way to get a web page updating
after a certain period of time?
Once solve my first question I'd like
to offer mi visitors a automatically
changing graphic.

Dynamic Php Tables
As you'll notice, each new result appears in a new table, which is very annoying. I am trying to make it so that all ther results appear in 1 table.

This is what I have so far;

<?
//error message (not found message)
$XX = "No Record Found";
$query = mysql_query("SELECT * FROM $usertable WHERE $metode LIKE '%$search%' LIMIT 0, 30 ");
while ($row = mysql_fetch_array($query))
{
$variable1=$row["Model"];
$variable2=$row["Creator"];
$variable3=$row["Title"];
print ("$variable1, $variable2 ,$variable3");
}

//below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}
//end
?>

Can anyone help please?

Dynamic Playlist In XML Using PHP
I want to build a dynamic playlist in XML using PHP.
can any body please help me by giving code,ideas and links?

Dynamic Variables
I am NEWBIE & trying to develop internal control system with PHP-MySql & have one problem.

I want to enter dynamic variable into MySql like :

"I have checked report of Mr. $userName from $previousDate to $currentDate…..”

Wherein - $username, $previousDate, $currentDate will be called from other table.

My codes :

PHP Code:

INSERT INTO `checkReport ` (`schID`, `schNo`, `noteNo`, `subschName`, `content`) VALUES (1, 1, 'a', '', ' I have checked report of Mr. ‘.$username.’ from ‘.$previousDate.’ to ‘.$currentDate.’ ….)

which is not working… Please guide me through.

Dynamic Table
I'm working on creating a dynamic table generator. The data is read from a database via mySQL. The table sample is: Code:

Dynamic Thumbnails
ImageCopyResampleBicubic()

here is a modified version of the above code that will properly handle copying only portions of images (i.e. creating a square thumbnail from a rectangular image by cropping out the square rather than smashing to fit). Also a few breaks were added to avoid some unnecessary calculations that took place under some conditions: PHP Code:

Dynamic Playlist, From URL
I have many complex ASX playlist files and would like to cut my work down managing them by having one line in them dynamicly created on the fly depending on a link the visitor clicks.

Is there a pre made processor that will look in the URL for a variable, insert that variable into a pre made ASX script and return that modified ASX script back to the client?

Dynamic Form
I have one user table in my MySQL database and this is linked to a user type table containing 3 types of user. Each type of user will be required to give a different amount of data when registering.

Basically I want to create one registration form for all types of users but only show the form fields that are relevant to the individual user type. The user type will be selected from a pervious page containing a list menu with the 3 user types that is sent via GET to the registration page.

Dynamic FAQ Software
Can anyone suggest some PHP software for maintaining a FAQs page?

I want to include moderate user contributions, but I don't mind modifying something to get what I want.

(I have tried searching for this but can't seem to come up with a search string that weeds out are the FAQs pages out there)

Dynamic Maps With Php?
I have a little php application to store day hiking trips and to keep a
running total of their yearly trips for a few users. Currently they
select their hiking routes using drop lists or checkboxes containing the
names and numbers of the trails. If the route is simple the form takes
1-2 minutes to fill in, if it involves lots of tiny sections it can
become tedious to search for every trailname and may take 20 minutes.
Because of this they have asked for a map, rather than lists, and want
to open the application to the public. Hmmm..

So I'm looking to create an application where users can select their
routes, by somehow selecting lines on a map, then somehow pass this to a
php script to process.

Dynamic Grid
I'm attempting to make a dynamic grid (3 x 3, so 9 squares total) I'm currently using a table because I don't feel like dealing with some css issues i was having in IE.

Anyway what i have is a 3 x 3 square
(periods used for spacing) ....

Dynamic Array
Say I have a function that is used to open different flat-file databases and read them into arrays. The databases have a different number of field indexes, with different names.

Is there a way of creating an array within a generic function, but with the field indexes as keys instead of just numbers?

Dynamic Arrays
People come to my site, they choose the name of a car from a database. I want the name of the car to go into an array. I want to put it in an array and not just as a single variable because i want them to have the option of coming back to the page and choose the name of another car. They can have as many names of cars as they like. To make sure i retain the values of the array, i will put them in a session variable.

My question is how do i generate the dynamic array? When people come back to the page with the values of the array in the session variable will that cause a problem?

Dynamic Zipping
I'm working on a downloads site at the moment and need to have a sort of dynamic zipping system, i'll explain:

1. A user visits the site, they are given an individual ID

2. They browse through the files and can click on the 'Add to Download' button if they wish.

3. If they click on the 'Get Download' button, then they are sent to a page, which offers them all the files they selected in a .zip or .tar file for downloading.

Dynamic Table
I am trying to create a table dynamically- meaning that a user will be able to add or delete rows via an admin tool. For now, the number of columns will be a fixed number. I figure I can store each row of information in a database and then keep some type of index to keep track of column inserts, deletions, etc. Does this make sense? Does any one have any ideas on how to accomplish this?

Dynamic Pages
I am trying to create a page which will automaticlly change the size of
tables/graphics etc based on the screen resolution. Eg, if someone is using
a 800x600 the page layout will utilise this. If the same webpage is
diaplayed on a 1024x768 or 1280X1024 the cells are adjusted according. By
doing something like this could you make the logo change size by using a
percent size in a table cell or is there a better method than tables? If
anyone is able to help with tips or any examples (code or url reference) it
would be appreciated.

Also, what page layout is better to use.. eg.. html, php,asp, etc. The
site will be hosted on apache on a Linux Server.

Dynamic Links
I would like to create dynamic return paths as links on site pages. For example, there might be a link to the whet stone page on both the chisel and plane pages. If my viewer came from the plane page, I'd like the return path to indicate "home->planes->whet-stones", appropriately linked. Likewise if from the chisel page, "home->chisels->whet-stones".

Above the immediate back link, normal site layout logic would apply. Should the referer page be off site, site layout would rule. This doesn't appear to be particularly difficult.

Dynamic Forms
I would like to know if it is possible to make a dynamic form. I've got to do some reservation forms for car rental agencies. There are about thirty different input possibilities on these forms. eg. some want to have a form that asks for the pickup time, and some want radio buttons that say pickup time is AM or PM. Each company would like about 10 of these to be on their form. If I have a database (MySQL) and can keep each customer preference in there, could I dynamically make a form?

Dynamic Dropdowns
I got a script a while back that populates dropdowns from a database, Im using PHP with this, WHat I want to do with the dropdowns is populate the list boxes depending on a variable that is passed through the URL, I can do it for the countries ok, but it wont load the citys I hope some one can help me out.

Its the javascript Im having the problem with. Heres the script, you will need to run this on a PHP enabl server with a mysql DB. PHP Code:

Dynamic Dropdown?
I am posting a code for dynamic dropdown by Leon Atkinson, it works fine but i have a doubt: I tried to add another functionality to it where i got stuck! Once the city also gets selected from the second drop down i wanted that on clicking the submit button it should go to some html page wrt to the city choice. Code:

Dynamic Charts
Is it possible to create dynamic charts or dynamic excel sheets to show charts and graphs based on values from database and display it on the web using php?

Dynamic Variable
i was wondering how to call a dynamic variable on php Code:

Dynamic Form
I need to create a form that takes a number that the user enters, and
duplicates a question the number of times the user entered. For
instance, if the customer enters 5 on the first page, when they press
next the form generates "How old are you?" 5 times on the page. The
customer will answer all 5 questions then press next. Finally, all the
local variables get dynamically created and written to a database.

I have already taken care of dynamically creating the question five
times. Using a simple WHILE clause, this generates the correct number
of questions. What I am having an issue with at this point, is how to
dynamically create the local variables.For instance, for the question
"How old are you?" I would need a unique variable for each instance;
using something like $Age(n). So that for five times, it would
automatically created variables $Age1 through $Age5. I have carried
over the number to the submit page by creating the variable $Number
and passing it along as hidden button on the form. $Age'$Number'
seemed to work for creating the variable, but $_post["Age'$Number'"]
doesn't work for referencing the global variable. I would need some
way of looping through and dynamically creating the variables.


Copyright © 2005-08 www.BigResource.com, All rights reserved