473,608 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP coding Question

art

Hi,

I'm sure a PHP genius will know this one.

I need to create 3 linked drop down menus on the page. The data is
coming from Mysql / PHP script.

I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.

Is there a way to create 3 linked drop down menus using PHP???

Thank you.

John
Jun 2 '08 #1
12 1286
On May 7, 12:55 pm, "a...@unsu. com" <ame...@iwc.net wrote:
Hi,

I'm sure a PHP genius will know this one.

I need to create 3 linked drop down menus on the page. The data is
coming from Mysql / PHP script.

I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.

Is there a way to create 3 linked drop down menus using PHP???

Thank you.

John
No. Drop down menus, for things like navigation bars, have to be done
on the client side. Traditionally this is down with either CSS (I
prefer this way) or JavaScript. PHP will serve to extract the data
from MySQL and format it for the menus. Do a google search for CSS
drop down or JavaScript drop down.

Regards,

Steve
Jun 2 '08 #2
art
On May 7, 12:00 pm, ELINTPimp <smsi...@gmail. comwrote:
On May 7, 12:55 pm, "a...@unsu. com" <ame...@iwc.net wrote:
Hi,
I'm sure a PHP genius will know this one.
I need to create 3 linked drop down menus on the page. The data is
coming from Mysql / PHP script.
I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.
Is there a way to create 3 linked drop down menus using PHP???
Thank you.
John

No. Drop down menus, for things like navigation bars, have to be done
on the client side. Traditionally this is down with either CSS (I
prefer this way) or JavaScript. PHP will serve to extract the data
from MySQL and format it for the menus. Do a google search for CSS
drop down or JavaScript drop down.

Regards,

Steve
Well, I have 2 question with that information:

First, can I use my PHP script to get the data, and then echo
everything, including the javascript? I think that would work.
Second, regarding CSS, I'm not sure how that would work, since the
data is coming from the database.....

Thanks for your quick reply.

John
Jun 2 '08 #3
On May 7, 1:04 pm, "a...@unsu. com" <ame...@iwc.net wrote:
On May 7, 12:00 pm, ELINTPimp <smsi...@gmail. comwrote:
On May 7, 12:55 pm, "a...@unsu. com" <ame...@iwc.net wrote:
Hi,
I'm sure a PHP genius will know this one.
I need to create 3 linked drop down menus on the page. The data is
coming from Mysql / PHP script.
I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.
Is there a way to create 3 linked drop down menus using PHP???
Thank you.
John
No. Drop down menus, for things like navigation bars, have to be done
on the client side. Traditionally this is down with either CSS (I
prefer this way) or JavaScript. PHP will serve to extract the data
from MySQL and format it for the menus. Do a google search for CSS
drop down or JavaScript drop down.
Regards,
Steve

Well, I have 2 question with that information:

First, can I use my PHP script to get the data, and then echo
everything, including the javascript? I think that would work.
Second, regarding CSS, I'm not sure how that would work, since the
data is coming from the database.....

Thanks for your quick reply.

John
Hi John,

Yes, that is exactly what you would do with the PHP (gather from db,
than 'echo').

As far as a CSS menu, you can do a google search to get more info/
tutorials...her e is a few:
http://sperling.com/examples/menuh/
http://www.cssplay.co.uk/menus/final_drop.html

Regards,

Steve
Jun 2 '08 #4
art
On May 7, 1:07 pm, ELINTPimp <smsi...@gmail. comwrote:
On May 7, 1:04 pm, "a...@unsu. com" <ame...@iwc.net wrote:
On May 7, 12:00 pm, ELINTPimp <smsi...@gmail. comwrote:
On May 7, 12:55 pm, "a...@unsu. com" <ame...@iwc.net wrote:
Hi,
I'm sure a PHP genius will know this one.
I need to create 3 linked drop down menus on the page. The data is
coming from Mysql / PHP script.
I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.
Is there a way to create 3 linked drop down menus using PHP???
Thank you.
John
No. Drop down menus, for things like navigation bars, have to be done
on the client side. Traditionally this is down with either CSS (I
prefer this way) or JavaScript. PHP will serve to extract the data
from MySQL and format it for the menus. Do a google search for CSS
drop down or JavaScript drop down.
Regards,
Steve
Well, I have 2 question with that information:
First, can I use my PHP script to get the data, and then echo
everything, including the javascript? I think that would work.
Second, regarding CSS, I'm not sure how that would work, since the
data is coming from the database.....
Thanks for your quick reply.
John

Hi John,

Yes, that is exactly what you would do with the PHP (gather from db,
than 'echo').

As far as a CSS menu, you can do a google search to get more info/
tutorials...her e is a few:http://sperling.com/examples/menuh/h...inal_drop.html

Regards,

Steve
I also saw this:
http://roshanbh.com.np/2008/01/popul...x-and-php.html

What do you think of that?

john
Jun 2 '08 #5
ar*@unsu.com wrote:
Hi,

I'm sure a PHP genius will know this one.

I need to create 3 linked drop down menus on the page. The data is
coming from Mysql / PHP script.

I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.

Is there a way to create 3 linked drop down menus using PHP???

Thank you.

John
Sure. Use the PHP to create the javascript.
Jun 2 '08 #6
ar*@unsu.com wrote:
On May 7, 12:00 pm, ELINTPimp <smsi...@gmail. comwrote:
>On May 7, 12:55 pm, "a...@unsu. com" <ame...@iwc.net wrote:
>>Hi,
I'm sure a PHP genius will know this one.
I need to create 3 linked drop down menus on the page. The data is
coming from Mysql / PHP script.
I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.
Is there a way to create 3 linked drop down menus using PHP???
Thank you.
John
No. Drop down menus, for things like navigation bars, have to be done
on the client side. Traditionally this is down with either CSS (I
prefer this way) or JavaScript. PHP will serve to extract the data
from MySQL and format it for the menus. Do a google search for CSS
drop down or JavaScript drop down.

Regards,

Steve

Well, I have 2 question with that information:

First, can I use my PHP script to get the data, and then echo
everything, including the javascript?
Yes.

I think that would work.
Second, regarding CSS, I'm not sure how that would work, since the
data is coming from the database.....
CSS is styling pure and simple.

You might use that to make things visible or invisible, or control
whether they drop over or under other objects.

Javascript does the actions

CSS controls the styles that are invoked by the actions.

Php handles the data and writes the javsacript on a per page basis.
Thanks for your quick reply.

John
Jun 2 '08 #7
ar*@unsu.com wrote:
Hi,

I'm sure a PHP genius will know this one.

I need to create 3 linked drop down menus on the page.
The data is coming from Mysql / PHP script.

I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.

Is there a way to create 3 linked drop down menus using PHP???

Thank you.

John
What do you mean by "linked menu" ??
Jun 2 '08 #8
art
On May 7, 1:34 pm, Tim Streater <timstrea...@wa itrose.comwrote :
a...@unsu.com wrote:
Hi,
I'm sure a PHP genius will know this one.
I need to create 3 linked drop down menus on the page.
The data is coming from Mysql / PHP script.
I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.
Is there a way to create 3 linked drop down menus using PHP???
Thank you.
John

What do you mean by "linked menu" ??

Well, you select something in the first drop down, and that will
display certain items in the second drop down, etc.....

The URL above seems the simplest to implement. I can just change the
SQL statements and such to match my database......

It looks like it is using AJAX, so most of the code is written for
me. I think I'll go with that, rather than having PHP echo out the
javascript, which can get very cumbersome..... .

Opinions?

And thank you.....

john

Jun 2 '08 #9
In article
<a8************ *************** *******@s50g200 0hsb.googlegrou ps.com>,
"ar*@unsu.c om" <am****@iwc.net wrote:
On May 7, 1:34 pm, Tim Streater <timstrea...@wa itrose.comwrote :
a...@unsu.com wrote:
Hi,
I'm sure a PHP genius will know this one.
I need to create 3 linked drop down menus on the page.
The data is coming from Mysql / PHP script.
I see lots of examples with this in Javascript, but I am getting the
data from my PHP script via MySQL.
Is there a way to create 3 linked drop down menus using PHP???
Thank you.
John
What do you mean by "linked menu" ??


Well, you select something in the first drop down, and that will
display certain items in the second drop down, etc.....
Right. I thought you meant that but wanted to be sure. When I had to do
this, I started off with the PHP generating a lot of javascript so that
all combinations were covered. This worked OK, but rapidly ceased to
scale.

My second approach involved iframes - putting the second and subsequent
menus in an iframe (a table cell constrains its size nicely). When a
choice is made in the first menu, the javascript causes the iframe to
get loaded with a page. You have to feed the page with the result of the
first menu choice so the PHP in the page can get the right data from the
database for the second menu. Third one works the same.

I've also verified that I can implement this using AJAX, but since the
first approach works I'm unlikely to change it any time soon.

Others may possibly indicate a better container than an iframe to hold
the <select>.
Jun 2 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2165
by: Larry | last post by:
Help Please http://www.angelfire.com/folk/ps197_brooklyn_ny I currently have a main page that has a list of about 50 names. I then have 50 pages that are linked to the main page The coding that is used on the main index page to go to one of the 50 linked pages is:
7
2559
by: Ralph Lund | last post by:
Hi. I am starting a new project with C#. I am searching for "good" coding conventions. I know that there are some coding conventions from microsoft, (but they are very extensive and not clear). In the example programs of Microsoft they use different coding conventions: private members sometimes with underscore, sometimes without; when calling a method sometimes: method(param1, param2) or method ( param1, param2) (with or without...
1
1693
by: R Reyes | last post by:
Hello All, I'm always looking for ways to improve my code. Most of the time (whenever I'm working on a project) I write a bunch of functions. Then after the project is finished, I put all the similar functions into their own module/class/page for neatness: -- like a stringsManipulate class which has all string manipulation methods to the project...separated from the whole project into its own library for neatness. -- like a...
7
4940
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already developed significant content for the C programming language that is available at: https://www.securecoding.cert.org/ by clicking on the "CERT C Programming Language Secure Coding Standard"
1
4679
by: Jennifer Jazz | last post by:
My question is regarding the mapping of Class diagram to the C++ coding. There are 3 realtions in Class diagram 1) Assosication 2) Composition 3) Aggregation (Weak Composition). -----------------------------------------------------
0
8087
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8025
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8509
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8493
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8365
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6847
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5499
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3993
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4053
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.