Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

php ID navigation


  • Please log in to reply

#1
netoster

netoster

    Member

  • Member
  • PipPip
  • 15 posts
hi all,

i just finished a site for a friend, and used the php id navigation, it works on local but when i uploaded the site i noticed it wasnt working anymore.....

Code is as follow:
<?php
switch($id) {
default:
include('empresa.php'); 
break; case "empresa": 
include('empresa.php'); 
break; case "sunscope":
include('sunscope.php');
break; case "membresia":
include('membresia.php');
break; case "contacto":
include('contacto.php');
}
?>

When you click in any link.. (links are: ?id=sunscope ; ?id=membresia ; ?id=contacto...) the page reloads but dont include the page you're requesting (sunscope;membresia or contact)...

Any ideas? i need help badly!

thanks in advance..

LINKS: you can check out by yourself the problem @ http://integral-logi...rvice.com/main/

notes:
both my PC and remote host uses last version of php.

Edited by netoster, 03 April 2007 - 02:15 PM.

  • 0

Advertisements


#2
netoster

netoster

    Member

  • Topic Starter
  • Member
  • PipPip
  • 15 posts
Solution found:

changing $id to $_REQUEST['id'] ....or $_GET['id']

hope this help someone!
  • 0

#3
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
An explanation of why that does not work.

If you have register_globals on the variable such as $_GET['id'] or $_POST['id'] can be accessed by useing $id. But that is very dangerous since it allows some one to set the value of any variable in your script. So your host has very wisely disabled it. So you have to use $_GET or $_POST.

Hope that explains something.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP