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
https://forums.phpfreaks.com/topic/35975-including-pages/
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
https://forums.phpfreaks.com/topic/35975-including-pages/#findComment-170641
Share on other sites

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.