Klance Posted March 19, 2008 Share Posted March 19, 2008 How do I simulate what scorehero.com has here: http://www.scorehero.com/top_scores.php I want somone to click on one category and have it show other categories without having to make a bunch of different html pages. How do I go about doing this? What would the code be like? Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/ Share on other sites More sharing options...
clown[NOR] Posted March 19, 2008 Share Posted March 19, 2008 maybe make everything in 1 file? <?php $group = $_GET['group']; $diff = $_GET['diff']; if ($group == "1") { if (empty($diff)) { // show the levels } elseif (!empty($diff)) { // show the things in the selected level } } elseif ($group == "2") { // repeat what you did in group 1 code } ?> Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/#findComment-495912 Share on other sites More sharing options...
Klance Posted March 19, 2008 Author Share Posted March 19, 2008 link=topic=188232.msg843837#msg843837 date=1205939598] maybe make everything in 1 file? <?php $group = $_GET['group']; $diff = $_GET['diff']; if ($group == "1") { if (empty($diff)) { // show the levels } elseif (!empty($diff)) { // show the things in the selected level } } elseif ($group == "2") { // repeat what you did in group 1 code } ?> Sorry, I'm kind of a PHP newb so can you elaborate on that at all... what would I do with that code and where would the link names go? Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/#findComment-495929 Share on other sites More sharing options...
keeB Posted March 19, 2008 Share Posted March 19, 2008 What you really want is either an AJAX implementation or JavaScript. What you're asking is not trivial. Please ask concise questions about what problems you're having -- the freelance section is over -> if you don't want to write it yourself. Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/#findComment-495944 Share on other sites More sharing options...
Klance Posted March 19, 2008 Author Share Posted March 19, 2008 Well can you tell me why this is not possible and what I need to do in order to make it? I'm asking for help, telling me I can't do it isn't helping me, telling me why I can't do it is helping... Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/#findComment-496013 Share on other sites More sharing options...
laffin Posted March 19, 2008 Share Posted March 19, 2008 Its more a question of DB Design and PHP integration, this can be done without Javascript/Ajax (But using Ajax will prevent page refreshes) As for the pages from the website, it's all the same script but some pages have 2 paramaters and others have 3. I want somone to click on one category and have it show other categories without having to make a bunch of different html pages. How do I go about doing this? What would the code be like? Is very vague. PHP is all about being dynamic content. I think u shud start with the tutorials on PHP and start learning. U will soon get to the MySQL and GET/POST features. it all depends on yer current level of programming with php. Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/#findComment-496035 Share on other sites More sharing options...
Klance Posted March 19, 2008 Author Share Posted March 19, 2008 Its more a question of DB Design and PHP integration, this can be done without Javascript/Ajax (But using Ajax will prevent page refreshes) As for the pages from the website, it's all the same script but some pages have 2 paramaters and others have 3. I want somone to click on one category and have it show other categories without having to make a bunch of different html pages. How do I go about doing this? What would the code be like? Is very vague. PHP is all about being dynamic content. I think u shud start with the tutorials on PHP and start learning. U will soon get to the MySQL and GET/POST features. it all depends on yer current level of programming with php. I've had experience with the GET/POST functions somewhat. I'm sorry for being vague. What I mean is that when I click on a category, I want links to appear on the next line based on the category that was clicked. If I were to do this with HTML I would have to make a bunch of different pages and it would be a huge hastle, but i'm starting to think it would be easier then figuring out how to do it in PHP.... Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/#findComment-496332 Share on other sites More sharing options...
Klance Posted March 20, 2008 Author Share Posted March 20, 2008 Can anyone help me? Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/#findComment-496519 Share on other sites More sharing options...
haku Posted March 20, 2008 Share Posted March 20, 2008 Someone already did. You need to use javascript if you want to have this stuff generated dynamically on the fly. Its not a php issue. If you want to do it in php it will require a page reload. If you are ok with that, then set up a check at the top of the page to see if anything has been selected from the first box. If it has, then have it output the applicable data beside that box. If you understand what I just said, then start working on it, and when you have some troubles come back here and ask for help. If you don't understand what I just said, then you don't know how to do it, and you would be best off either learning php and AJAX basics, or going to the freelance section of the forum and seeing if you can find someone to do it for you. Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/#findComment-496520 Share on other sites More sharing options...
Klance Posted March 20, 2008 Author Share Posted March 20, 2008 Someone already did. You need to use javascript if you want to have this stuff generated dynamically on the fly. Its not a php issue. If you want to do it in php it will require a page reload. If you are ok with that, then set up a check at the top of the page to see if anything has been selected from the first box. If it has, then have it output the applicable data beside that box. If you understand what I just said, then start working on it, and when you have some troubles come back here and ask for help. If you don't understand what I just said, then you don't know how to do it, and you would be best off either learning php and AJAX basics, or going to the freelance section of the forum and seeing if you can find someone to do it for you. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/96913-how-do-i-do-this-simple-thing/#findComment-496525 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.