473,699 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

$_GET not available problem?

2 New Member
I have the following code:

<?php

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

?>

The file is called test_globals.ph p.
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_global s 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 3943
LeagueWebmaster
6 New Member
: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
srussell
2 New Member
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
19116
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 register_globals was set to ON. The client then notified his host who seemed to know exactly the issue and we added these lines to the top of the script (this script is included in all other scripts) and it solved the problems: /* mp.net patch...
2
3409
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... but I dont understand why! It started when I "compresed" script and addet $_GET in the same "if" set... but it shoudent by eny problem...
7
11875
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 the top of my script I assign a few variables to incoming GET and POST values. $login = clean($_POST, 30); $passwd = clean($_POST, 30);
27
5320
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 use it in an url
1
1640
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 this script on it: <?php echo "variable to get $variableToLookFor "; $try = $_GET; echo " == the server says the variable to get is $try == ";
2
1774
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 AJAX requests so that your server > application can detect that it's an AJAX call, rather than a normal call. The header is: > > X-Requested-With: XMLHttpRequest >
9
9717
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
3135
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, if not they are redirected to the login page. If logged in they may edit the story. I assign $_GET to $id.
8
5569
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: ./ index.php?a=1&amp;B=2). But, if that is done, then the _GET or _REQUEST array element names are incorrect. In the example the _GET array will be: _GET = 1 (instead of _GET = 1) and _GET = 2 (instead of _GET = 2). So, how do I get around this?...
0
9199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8944
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7786
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5889
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4638
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3075
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2364
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2016
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.