|
-
Feb 24th, 2003, 06:16 AM
#1
Thread Starter
Lively Member
very easy qustion??HELP??
Hi
I need a very simple php page but I couldn't write it yet
I need some help
the page should do this job:
if we goto www.mydomain.com/page.php
the page should do this :
include('body/index_body.php');
if we goto www.mydomain.com/page.php?mode=index
the page should do this :
include('body/index_body.php');
if we goto www.mydomain.com/page.php?mode=phpbb
the page should do this :
include('body/phpbb_body.php');
if we goto www.mydomain.com/page.php?mode=about
the page should do this :
include('body/about_body.php');
HOW CAN I DO THIS
PLEASE HELP
THANKS
AL_TNEN
-
Feb 24th, 2003, 07:13 AM
#2
Registered User
PHP Code:
if (!isset($mode)){
$incfile = "index_body.php";
}
if ($mode=="index"){
$incfile = "index_body.php";
} elseif ($mode=="phpbb"){
$incfile = "phpbb_body.php";
} elseif ($mode=="about"){
$incfile = "about_body.php";
} else {
$incfile = "index_body.php";
}
include("body/$incfile");
I think that should work - not tested.
s.
-
Feb 24th, 2003, 09:54 AM
#3
Thread Starter
Lively Member
THANKS silva, BUT THIS ISN"T WORKING
-
Feb 24th, 2003, 09:58 AM
#4
Originally posted by Tnen
THANKS silva, BUT THIS ISN"T WORKING
Are you $_GETting the string properly?
Post all your code, plz.
-
Feb 24th, 2003, 12:14 PM
#5
Thread Starter
Lively Member
THIS IS ALL
PHP Code:
<?php
if (!isset($mode)){
$incfile = "index_body.php";
}
if ($mode=="index"){
$incfile = "index_body.php";
} elseif ($mode=="phpbb"){
$incfile = "phpbb_body.php";
} elseif ($mode=="about"){
$incfile = "about_body.php";
} else {
$incfile = "index_body.php";
}
include("body/$incfile");
?>
-
Feb 24th, 2003, 03:43 PM
#6
Frenzied Member
Re: very easy qustion??HELP??
Originally posted by Tnen
Hi
I need a very simple php page but I couldn't write it yet
I need some help
if it is so simple then why can't you do it??? and how do you know if it is simple if you can't do it in the first place.
PHP Code:
<?php
switch $_GET["mode"]{
case "phpbb":
include("body/phpbb_body.php");
break;
case "about":
include("body/about_body.php");
break;
default:
include("index_body.php");
}
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|