Jump to content

Recommended Posts

Hey!

 

I hope this makes sense, I guess I'll start with a little background... I was working for a company who had a website and it used php/mysql well there was a database full of different education degrees and when you went to the main page it listed each one from the database but then if you clicked on one of the degrees it went to a new page all about that degree and it pulled the info from the database.

 

my question is how can I do this, the guy who made the website didn't make a page for each and every degree he only made one and then somehow he coded it so it would make the other pages when you click it.

 

here is the site i am talking about there is a list of degrees

http://360-edu.com/professional_development.php

 

 

thanks for the infomation!

Hey!

 

I hope this makes sense, I guess I'll start with a little background... I was working for a company who had a website and it used php/mysql well there was a database full of different education degrees and when you went to the main page it listed each one from the database but then if you clicked on one of the degrees it went to a new page all about that degree and it pulled the info from the database.

 

my question is how can I do this, the guy who made the website didn't make a page for each and every degree he only made one and then somehow he coded it so it would make the other pages when you click it.

 

here is the site i am talking about there is a list of degrees

http://360-edu.com/professional_development.php

 

 

thanks for the infomation!

 

Have you ever used php before? All you have to do is either make the link submit a GET request (parameters in the URL) or I believe you need to also use javascript to have it submit a POST request.

Ok, its all the same page. check it

 

if($degree == 'bachelors'){
print "This is my bachelors degree information";
}
if($degree == 'associates'){
print "This is my associates degree information";
}

 

Get it? So the site does this, theres a list of links

Home
Degrees
Contact

 

You click "Degrees" and another link list

 

Bachelors
Associates

 

You click "Bachelors" which opens the function page as stated above,m which again would (in its simplest form) look like this

 

if($degree == 'bachelors'){
print "This is my bachelors degree information";
}
if($degree== 'associates'){
print "This is my associates degree information";
}

 

All that info can actually just be on one page by passing variables through the script or url.

 

Hey!

 

I hope this makes sense, I guess I'll start with a little background... I was working for a company who had a website and it used php/mysql well there was a database full of different education degrees and when you went to the main page it listed each one from the database but then if you clicked on one of the degrees it went to a new page all about that degree and it pulled the info from the database.

 

my question is how can I do this, the guy who made the website didn't make a page for each and every degree he only made one and then somehow he coded it so it would make the other pages when you click it.

 

here is the site i am talking about there is a list of degrees

http://360-edu.com/professional_development.php

 

 

thanks for the infomation!

 

When the main page loads it retrieves all degree titles and their unique id from the db and lists them with the id appended to the URL in the link, like:

 

http://360-edu.com/professional_development/199/Administration_of_School_Library_Media_Centers.htm

 

So when professional_development loads it checks the get vars in the request, in this case 199 and then retrieves the degree info from the db using the unique key 199 and displays that.

 

This site is using URL rewriting to makes the URLs more friendly looking, but normally they would look like this:

 

http://360-edu.com/professional_development.php?id=199

 

So professional_development.php would be something like this:

 

if(isset($_GET['id'])) {
   // retrieve and display details for the specific degree with id = $_GET['id'] from db
} else {
   // retrieve name and id for all degrees and display the links for each one
} 

Thanks for all the information that definitely will help put me on the correct track with google haha.

 

on a side note does anyone know any good php tutorials, because I've gone through the ones on w3school and tizag but I feel like most the information is so simple it doesnt help with actual real life situations (such as the one i'm talking about)

 

Thanks

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.