?
Solved

GET does not work

Posted on 2003-02-26
3
Medium Priority
?
134 Views
Last Modified: 2006-11-17
I have reinstaled computer (now XP and last version of PHP 4.3.1).
Scripts that was working before (I use IIS build in XP) does not work not. Concrete GET metod does not transfer variables.

I call script 'script.php?var1=aaaaa&var2=bbbbb' and in script are var1 and var2 not assigned :(

(issset(var1) return false)

Can you help me, please?
thanks, Michal
0
Comment
Question by:michi001
[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
3 Comments
 
LVL 1

Expert Comment

by:KC_Speedball
ID: 8024722
Try $_get['var1']
0
 
LVL 2

Accepted Solution

by:
linxit earned 200 total points
ID: 8024818
In a little more detail:

Your old script relied on 'register_globals = on' in php.ini. However, it was found this was insecure, so for quite some time now the default is for register_globals to be off.

So, var1 is still available, but you have to reference it as $_GET['var1']. (NOT $_get['var1'] - variables are case-sensitive in PHP).

For post variables, use $_POST['varname'], and for $PHP_SELF you now use $_SERVER['PHP_SELF']

For a full explanation, look here:
http://www.php.net/manual/en/reserved.variables.php

Andy
0
 
LVL 15

Expert Comment

by:VGR
ID: 8024966
yes to linxit (eugaine :D )

other solution : set register_globals=On in your php.ini file
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

771 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