Jump to content

Including pages


freelancer

Recommended Posts

Hello, I'm not very good at PHP so I think you may help me in this case. I'm using this for including pages and URL comes like index.php?k=[b]whatever[/b] and all works. But now I want to add new 'if' under my TEAM page. There will be members and if you click on someones name then address comes like index.php?k=team&id=[b]playername[/b]. There is code I made. This works fine and includes certain page to place where I put this script. What should I add or do?

[code]<?php

if (($k == 'news') or ($k =='')) {
  include("news/news.php");
  } else if ($k == 'articles') {
include('articles.php');
  } else if($k == 'team') {
include('team.php');
  } else if($k == 'results') {
include('results.html');
  } else if($k == 'about') {
include('about.html');
  } else if($k == 'servers') {
include('servers.html');
  } else if($k == 'sponsors') {
include('sponsors.html');
  } else if($k == 'contact') {
include('contact.html');
  }
    ?>
[/code]

Thank you! :)
Link to comment
Share on other sites

[quote author=HoTDaWg link=topic=124321.msg514881#msg514881 date=1169927243]
well there is a much more easier way to do your task. it is called cases.
[url=http://ca3.php.net/switch]http://ca3.php.net/switch[/url]
[/quote] I took look over it, but I didn't get how does this work. :(
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.