Jump to content

Using $action - Newb Question - [DONE]


Demorgon

Recommended Posts

As in the Subject... I am not familair with PHP at all I'm a major newb.. But my question is how can I achieve  what I have explained below.

I already created my php page -> maps.php

I have a list of games and instead of loading another page I was wondering what tags ect... I could use so that it could be like below.

Lets say one of the links is for - Quake so I would like the link to read --> maps.php?action=quake

I do not want to use a database for this I just was hoping each Game Map page code could be contained within the maps.php but not viewed untill the maps.php?action=quake link is clicked..

I'm not sure if this is the correct way to do what I'm asking but anything close would be a great help...

Thanks in advance.


{EDIT}

I apolagize MODS I overlooked it in the PHP F.A.Q. - Feel free to delete this thread... Again sorry.  :-\
Link to comment
https://forums.phpfreaks.com/topic/25245-using-action-newb-question-done/
Share on other sites

[code]<?php

$action = $_GET["action"];

switch($action) {
    case "quake":
//include content for quake page
break;

    case "doom":
//include content for doom page
break;

    default:
//Show default page
break;
}

?>[/code]

For easier content management I would suggest creating separate pages with the actual content and just including the appropriate content pages within the select statement. Be sure to put whatever common content the pages will have on this page before and after the select, but just put the different content into separate pages.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.