Jump to content


php extensions help needed


3 replies to this topic

#1 martinbuezas

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 22 February 2008 - 10:21 PM

Hi, I had recently install Apache 2.0, PHP 5 and MySQL 5. The server is working fine except I can't figure out what I have to do - which extension to install or enable - to make my 'switch includes' navigation work, as it does on my paid server.

This is the system i'm using:

Links: index.php?id=5

switch($id) { default: include('Home.php');
                break; case "1": include('Asesor1.php');
                break; case "2": include('Asesor2.php');
                break; case "3": include('Asesor3.php');
                break; case "4": include('Asesor4.php');
                break; case "5": include('Asesor5.php');
                }

I would appreciate any help. Thanks!

#2 Chaos King

    Senior Programmer

  • P2L Staff
  • PipPipPip
  • 676 posts
  • Gender:Male
  • Location:Florida

Posted 23 February 2008 - 07:54 AM

PHP5 automatically has register_globals turned off due to security reasons.

Try adding this at the top:

$id = $_GET['id'];


#3 martinbuezas

    Young Padawan

  • Members
  • Pip
  • 2 posts

Posted 23 February 2008 - 01:59 PM

View PostChaos King, on Feb 23 2008, 10:54 AM, said:

PHP5 automatically has register_globals turned off due to security reasons.

Try adding this at the top:

$id = $_GET['id'];

It's still not working... it does load the default include but not switching... any idea?

Thanks for the fast reply!

#4 communiti.ch

    Young Padawan

  • Members
  • Pip
  • 52 posts

Posted 23 February 2008 - 06:41 PM

try putting default at the end of the switch without break;

example:
switch($id)
{
case 'bla':
// bla bla bla
break;
default;
}

Anyways, make sure you have php_mbstring and php_pdo extensions active! ^^

Edited by rc69, 24 February 2008 - 07:41 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users