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
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.
Link to comment
Share on other sites

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.