TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

BIG problem with code please help URGENT

Page: 1 Reply
Sep 6th 2002#68017 Report
Member since: Sep 3rd 2002
Posts: 22
hey,
i used the following code at the top of a page called info.php.

if($action=="staff")
{
include("staff.php");
}

if($action=="about")
{
include("about.php");
}

if($action=="faq")
{
include("faq.php");
}
?>

but when i go to info.php?action=staff it loads staff.php and then info.php underneith but i don't want info.php to appear aswell just staff.php on its own!

any help please?
Reply with Quote Reply
Sep 6th 2002#68043 Report
Member since: Apr 1st 2002
Posts: 1487
put all the code for info.php into a function, then make another if statement that says 'if ($action=="info") { call_info (); }' if that doesn't work. let me know. :D
Reply with Quote Reply
Sep 7th 2002#68116 Report
Member since: Jun 30th 2001
Posts: 447
Try using a switch statement. Also, register globals might be off on your system.

[php]
switch ($_GET['action']) {
case 'staff':
include 'staff.php';
break;
case 'faq':
include 'faq.php';
break;
case 'about':
include 'about.php';
break;
}
?>[/php]
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum