473,385 Members | 1,396 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,385 software developers and data experts.

$_GET not available problem?

I have the following code:

<?php

print "1. " . $_GET['c'] . "-2. " . $_GET['s'];

?>

The file is called test_globals.php.
On most servers I can type:

http://servername/test_globals.php?c=yes&s=no

and the output will be similar to:

1. yes-2. no

However, on one server, I get the following result:

1. -2.

My question is, why doesn't $_GET return the values of "yes" and "no" ?
On this server (which is running Apache 2.0 and PHP 4.2.2), register_globals is set to 'on' and safe-mode is set to 'off'. I've already tried to change the code to:

<?php

print "1. " . $c . "-2. " . $s;

?>

and still get the result:

1. -2.

Are there any other directives that must be set in a certain way to enable
$_GET ?

Thanks all.
Sean
Oct 4 '05 #1
2 3925
:o Look at the Revision of PHP. ;) $_GET wasn't implemented until version 4.1.0. You may have to revert to using the older function $HTTP_GET_VARS.
Oct 4 '05 #2
Okay, I tried substituting $_GET with $HTTP_GET_VARS but still get the same result of:

1. -2.

I don't know if this matters but the server is a secure server, meaning it's accessed with the protocol prefix of "https" rather than "http":

https://servername/test_globals.php?c=yes&s=no

Maybe I should have mentioned this initially.
The php version is 4.2.2, so $_GET should be available, not to mention $HTTP_GET_VARS.

Thanks though,
Sean
Oct 4 '05 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: gf | last post by:
I had a client recently contact me with a script that wasn't working. I quickly isolated the problem as to the fact that the $_GET array was not being made available to all scripts, even though...
2
by: carramba | last post by:
Hi! Tahnx for taking time and reading! This script should load default page and default stylesheet, but its only loads default page, you have to actualy click on the style link to load style......
7
by: Dan | last post by:
I was trying to troubleshoot a login page that doesn't work - it keeps saying the login/password is missing - when my tracing discovered this peculiar behavior. register_globals is off, so at...
27
by: meltedown | last post by:
urlencode turns # into %23 When I sent it thru $_GET, it dissapears, along with anything that comes after it. for example: urlencode turns HOYDM_EXC_#4_NAT into HOYDM_EXC_%234_NAT When I...
1
by: lawrence k | last post by:
If I copy and paste this url into my browser: http://www.bluecasts.com/index.php?templateId=PT_distroDemo.txt&amp;distroTitle=priceTitle.php&amp;distroMainContent=prices.php and I've a simple page with...
2
by: lawrence k | last post by:
I noticed this odd PHP function in an article about AJAX and Prototype: > http://www.sitepoint.com/article/painless-javascript-prototype/2 > > Prototype adds a custom HTTP header to all its...
9
by: wouter | last post by:
hey hi..... I wanna make a switch wich does this: if pagid is set do A, if catid is set do B, if projectid is set do C, else do D. So i was thinking something like this:
2
by: keeps21 | last post by:
I have a script that recieves an id number via the address bar when a link is clicked. ie . index.php?id=1 if the link was for the story whose ID is 1. My script checks if a user is logged in,...
8
by: The KwikOne | last post by:
Since to have a page validate (HTML and XHTML) you should have your URL parameters separated by the appropriate separator. However, if an ampersand is used it needs to be expressed as &amp; (example:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.