[SOLVED] Problems sending variable trough URL
Moderator: General Moderators
[SOLVED] Problems sending variable trough URL
This is not the problem with register globals in the newer versions of PHP.
The server I use is running PHP 4.1.2, and register globals is on.
My problem is as follows:
When I send a variable in my URL like this: ....server/test.php?variable=test
and on the test.php page I have
<?
echo ("$variable");
?>
It returns nothing.
I have also tried $variable=$_GET['variable']; and
@extract($_GET);
but nothing seems to help.
Setting $variable=("test"); in test.php gives me the desired result though.
Any suggestions?
The server I use is running PHP 4.1.2, and register globals is on.
My problem is as follows:
When I send a variable in my URL like this: ....server/test.php?variable=test
and on the test.php page I have
<?
echo ("$variable");
?>
It returns nothing.
I have also tried $variable=$_GET['variable']; and
@extract($_GET);
but nothing seems to help.
Setting $variable=("test"); in test.php gives me the desired result though.
Any suggestions?
test.php:
Code: Select all
<?php
ini_set("display_errors","1");
ini_set("error_reporting","2047");
echo "<pre>echo works if you see this message\n";
echo "What we've got:\nREQUEST:";var_dump($_REQUEST);
echo "\nPOST:";var_dump($_POST);
echo "\nGET:";var_dump($_GET);
echo ($variable);
?>test.php?variable=test gave the same result.
Seems like there is an error with my service provider's php configuration.
You can test the page at http://www.alfern.com/capo2/info.php?variable=test . I also added phpinfo();
Seems like there is an error with my service provider's php configuration.
You can test the page at http://www.alfern.com/capo2/info.php?variable=test . I also added phpinfo();
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Look at this:
They use some sort of redirecter which is rewriting the request and do not include query string in it.
[edit]
Try this: http://home.no.net/alfern2/capo2/info.php?variable=test.
[/edit]
Code: Select all
weirdan@office:~$ telnet www.alfern.com 80
Trying 204.251.10.212...
Connected to www.alfern.com.
Escape character is '^]'.
GET http://www.alfern.com/capo2/info.php?variable=test HTTP/1.1
Host: www.alfern.com
HTTP/1.1 200 OK
Date: Tue, 18 Nov 2003 12:16:21 GMT
Server: tigershark/3.0.111 (dn2.directnic.com)
Content-Type: text/html
Content-Length: 345
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>alfern.com</TITLE>
</HEAD>
<FRAMESET rows="100%,*" border=0 frameborder=0 framespacing=0>
<FRAME name=top src="http://home.no.net/alfern2/capo2/info.php" noresize>
</FRAMESET>
</HTML>
Connection closed by foreign host.[edit]
Try this: http://home.no.net/alfern2/capo2/info.php?variable=test.
[/edit]