PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
hyder_m29
Forum Newbie
Posts: 12 Joined: Mon Jun 23, 2008 9:36 am
Post
by hyder_m29 » Mon Jul 21, 2008 3:27 pm
Php Url: www[dot]somewebsite[dot]com/feedback.php?url=feedback_empty.php
Php Relevant Code:
Code: Select all
if (trim($_GET['url']) == '')
$navigateToUrl = "feedback_list.php"; // always gets here
else
$navigateToUrl = $_GET['url'];
header("Location: $navigateToUrl");
Why is my $_GET['url'] always empty?
Php always loads feedback_list.php regardless of whether url parameter is set or not
register_globals is set to off... does that affect superglobals?
califdon
Jack of Zircons
Posts: 4484 Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA
Post
by califdon » Mon Jul 21, 2008 3:58 pm
Have you tried echoing the value of $_GET['url']?
hyder_m29
Forum Newbie
Posts: 12 Joined: Mon Jun 23, 2008 9:36 am
Post
by hyder_m29 » Mon Jul 21, 2008 5:51 pm
califdon wrote: Have you tried echoing the value of $_GET['url']?
Yes, its blank!
califdon
Jack of Zircons
Posts: 4484 Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA
Post
by califdon » Mon Jul 21, 2008 7:34 pm
...and yet, you can see it there in the URL? Hmmm. Can you test it on another, really simple script pair? If $_GET just isn't working, it must be the settings in your PHP configuration. I'm getting out of my depth there, so I hope someone else will be able to shed more light on this.
manixrock
Forum Commoner
Posts: 45 Joined: Sun Jul 20, 2008 6:38 pm
Post
by manixrock » Mon Jul 21, 2008 8:06 pm
try
print_r() 'ing the $_GET like this:
and write here both the URL and the resulting page.
gmapsuser
Forum Newbie
Posts: 5 Joined: Mon Jul 21, 2008 11:47 pm
Post
by gmapsuser » Tue Jul 22, 2008 1:11 am
Which version of PHP are you using? If it is earlier than 4.1.0 then use $HTTP_GET_VARS variable instead.
Apollo
Forum Regular
Posts: 794 Joined: Wed Apr 30, 2008 2:34 am
Post
by Apollo » Tue Jul 22, 2008 1:37 am
gmapsuser wrote: Which version of PHP are you using? If it is earlier than 4.1.0 then use $HTTP_GET_VARS variable instead.
And on top of that, if your code above is inside a function, get access to the array inside your funcion by specifying
global $HTTP_GET_VARS;
LSJason
Forum Commoner
Posts: 45 Joined: Mon May 12, 2008 4:43 pm
Post
by LSJason » Tue Jul 22, 2008 9:13 am
On top of what everyone just said...that code is HORRIBLY insecure.