473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

variables not recognised

Hi Folk

I loaded a website onto a new webserver (from some ISP that I know little
about and I noticed that even though everything seemed to be working fine,
it does not actually recognise variables.

usually, if I have http://www.myurl.com/index.php?x=1 then $x == 1 in my
php file. However, on this ISP it sure did not do this.

Is this
a. an old version of PHP
b. a security feature
c. something else or had to know

TIA

- Nicolaas
Aug 28 '05 #1
3 1084
windandwaves wrote:
usually, if I have http://www.myurl.com/index.php?x=1 then $x == 1
in my php file. However, on this ISP it sure did not do this.

Is this
a. an old version of PHP
b. a security feature
c. something else or had to know


My guess is that your code relies on register globals being enabled. Since
PHP 4.2 this directive is disabled by default, so $x should be referenced as
$_GET['x'].

See: http://www.php.net/register_globals
JW

Aug 28 '05 #2
Janwillem Borleffs wrote:
windandwaves wrote:
usually, if I have http://www.myurl.com/index.php?x=1 then $x == 1
in my php file. However, on this ISP it sure did not do this.

Is this
a. an old version of PHP
b. a security feature
c. something else or had to know


My guess is that your code relies on register globals being enabled.
Since PHP 4.2 this directive is disabled by default, so $x should be
referenced as $_GET['x'].

See: http://www.php.net/register_globals

Thank you, right on the ball! I have asked them if I can change the php.ini
file and I am using $_GET for now.

Thank you .

- Nicolaas
Aug 28 '05 #3
If I were you I'd try to rewrite things without using register globals
(i.e. using $_GET and $_POST). While it isn't a security risk in and
of itself, register globals does make it easier to write vulnerable
code.

Besides, if you write your site without relying on register globals, it
will run on a host with or without it. On the other hand, if you write
it using register globals, the site won't work without it.

Aug 28 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: PhilM | last post by:
perhaps I am just a little tired, but I am having trouble with my form buttons. Firstly I name them like this name=\"round".$counter."heats\" which results in variables $round1heats...
8
by: Dave Thomas | last post by:
I have developed a web site using asp pages that use both vbscript and javascript. Run the site on my PC and everything is fine. Ftp to my web hosting provider which hosts asp pages and look on my...
22
by: Tom Moroow | last post by:
Hi, I'm pretty new to javascript and was wondering how you would piece together a variable name and then assign it a value. I want to create a hidden field and assign it a value based on the value...
3
by: Sugapablo | last post by:
Ok, here's my dumbdumb question of the day: I have this loop that's supposed to loop through the 11 XML elements named "title" in the object. When I put a number in the array brackets like...
8
by: Ess355 | last post by:
Hi, In the debugger at run time, characters like é are not recognised by their normal ASCII number, but something like -8615722... . I've seen this number before, it means "rubbish" right? So...
15
by: Casanova | last post by:
Hello!! how can i get all the details of the environmental variables. If i use getenv, i will have to specify the name of the variable. for intsance i will have to give getenv("PATH") How can...
44
by: fabio | last post by:
Why? i' ve heard about this, the usage of global vars instead of locals is discouraged, but why? thx :)
18
by: RB | last post by:
Hi guys (and gals!), I've got 2 classes, "TypesafeConstant" and "Color". "Color" inherits from "TypesafeConstant", and adds no new functionality. All "Color" does is to instantiate some class...
11
by: sinbad | last post by:
hi, I've a very large C program consisting of hundred of files; I want to know what are all the global variables defined in the program. how do i do this. thanks
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.