hi...this is my 1st post.
i looked around the tutorials for help, but i think my question is so basic that i can't find an answer for it.
i'm trying to use PHP with a drop down box exactly like this:
http://alexisstrum.com/_objects/ipod/default.php
i understand most of the code, and i've implemented php in some basic ways in the past, but i don't understand these specfic "values" and how to store the actual content on each page?
what kind of file is being called up that is simply named "7" or "8".
thankyu.
simple php question..
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
You are not wasting your time at all, this is a very valid question and we will be happy to assist you.
From looking at that site, it doesn't look like it is including any files.. possibly making database calls of menu items with the correlating ID which is found in the url.
A very simple example would be
Do let us know if you need anything clarified to expanded upon.
From looking at that site, it doesn't look like it is including any files.. possibly making database calls of menu items with the correlating ID which is found in the url.
A very simple example would be
Code: Select all
//lets grab a valid number for our very
$id = (isset($_GET['id']) && is_numeric($_GET['id']) ? $_GET['id'] : 1)
$result = mysql_query('SELECT * FROM `menu_items` WHERE `parent_id` = '.$id);
// fetch the results
while ($row = mysql_fetch_assoc($result))
{
// display each menu item
}thankyou
thanks Jcart. i sincerely appreciate your help.
i've just built this website for my band: http://violetnine.com
i'm trying to learn new and better ways of doing things.
i normaly just put everything inside one large HTML file...as you'll see.
then, i noticed websites that will use PHP pages and i'm not sure why.
what is the advantage of using them?
i know they are good for more complicated tasks, but i don't know what the advantage is to using PHP when the file you are making is just a simple webpage with basic content.
specifically in examples like these:
http://motioncitysoundtrack.com/news.php
http://anberlin.com/index2.php?AllNews
you can ignore any "flash" stuff. i'm just trying to understand why it's a PHP file and not an HTML.
my guess is that somehow using PHP, you can update the "news" section more easily???
or is it essentially doing the same thing?
thanks very much,
tom
i've just built this website for my band: http://violetnine.com
i'm trying to learn new and better ways of doing things.
i normaly just put everything inside one large HTML file...as you'll see.
then, i noticed websites that will use PHP pages and i'm not sure why.
what is the advantage of using them?
i know they are good for more complicated tasks, but i don't know what the advantage is to using PHP when the file you are making is just a simple webpage with basic content.
specifically in examples like these:
http://motioncitysoundtrack.com/news.php
http://anberlin.com/index2.php?AllNews
you can ignore any "flash" stuff. i'm just trying to understand why it's a PHP file and not an HTML.
my guess is that somehow using PHP, you can update the "news" section more easily???
or is it essentially doing the same thing?
thanks very much,
tom
in an easy and simpefied way: php is used to generate html acording on the content.
The content is stored usualy on a database (mysql, postgres, or others) or in text files.
google for "php connect a mysql database"
or "php guesbook tutorial"
it's not at all as dificult as most think.
All of us are here to help and be helped so post you questions
BTW great site
The content is stored usualy on a database (mysql, postgres, or others) or in text files.
google for "php connect a mysql database"
or "php guesbook tutorial"
it's not at all as dificult as most think.
All of us are here to help and be helped so post you questions
BTW great site
ah..
thanks for the help you two.
that all makes sense, and was what i had assumed.
seems nice to be able to update content more easily that way.
i'll google what you mentioned and then read up on it more.
if i can't figure it out, i'll ask more questions.
thanks!
tom
that all makes sense, and was what i had assumed.
seems nice to be able to update content more easily that way.
i'll google what you mentioned and then read up on it more.
if i can't figure it out, i'll ask more questions.
thanks!
tom