Rifts Posted July 14, 2010 Share Posted July 14, 2010 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! Quote Link to comment https://forums.phpfreaks.com/topic/207772-very-confusing-question-auto-generate-pages/ Share on other sites More sharing options...
aeroswat Posted July 14, 2010 Share Posted July 14, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/207772-very-confusing-question-auto-generate-pages/#findComment-1086135 Share on other sites More sharing options...
Rifts Posted July 15, 2010 Author Share Posted July 15, 2010 I'm not talking about making a form? Quote Link to comment https://forums.phpfreaks.com/topic/207772-very-confusing-question-auto-generate-pages/#findComment-1086639 Share on other sites More sharing options...
runthis Posted July 15, 2010 Share Posted July 15, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/207772-very-confusing-question-auto-generate-pages/#findComment-1086643 Share on other sites More sharing options...
AbraCadaver Posted July 15, 2010 Share Posted July 15, 2010 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 } Quote Link to comment https://forums.phpfreaks.com/topic/207772-very-confusing-question-auto-generate-pages/#findComment-1086648 Share on other sites More sharing options...
runthis Posted July 15, 2010 Share Posted July 15, 2010 Couldn't agree more Quote Link to comment https://forums.phpfreaks.com/topic/207772-very-confusing-question-auto-generate-pages/#findComment-1086649 Share on other sites More sharing options...
Rifts Posted July 15, 2010 Author Share Posted July 15, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/207772-very-confusing-question-auto-generate-pages/#findComment-1086652 Share on other sites More sharing options...
runthis Posted July 15, 2010 Share Posted July 15, 2010 Actually tiztag and w3 are your best option right now to start, theyre website would have had your answer php.net can be confusing but helpful Quote Link to comment https://forums.phpfreaks.com/topic/207772-very-confusing-question-auto-generate-pages/#findComment-1086656 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.