[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Retreiving data with register_globals=off

Posted on 2003-12-03
4
Medium Priority
?
239 Views
Last Modified: 2006-11-17
My code was working fine until I upgraded to a newer PHP version, now I'm having major problems.

I have an index page, which takes a var like this: "http://www.mysite.com/index.php?page=12"

I used to use this simple code:

$HTTP_GET_VARS[$page];

to extract the page number, but this no longer works, so can someone please tell me what I should be using.

I know I can turn on register_globals but i dont want to...

Thanks
0
Comment
Question by:rjdown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:LornaJane
ID: 9867008
You don't need to turn on register_globals, but you do need to refer to your variable differently.  Try using this instead

$GET['page']

I hope this helps :)
0
 
LVL 6

Author Comment

by:rjdown
ID: 9867112
Thanks for quick reply but still nothing...

I made a new file, test.php:

<?php
$GET['page'];
echo $page;
?>

now if i go to this using test.php?page=23 i still get a blank page? :'(
0
 
LVL 5

Accepted Solution

by:
LornaJane earned 200 total points
ID: 9867210
try this, I don't think I explained myself terribly well before:

<?php
$page = $GET['page'];
echo $page;
?>

If you don't understand what the above code does, post back and I'll explain more clearly
0
 
LVL 6

Author Comment

by:rjdown
ID: 9867586
Oops, my bad.

I had a look through the php manual and found that it should in fact be $_GET. Horrah, my code works again :D

Thanks Lorna :D

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question