472,980 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

parameters in URL not readable

Hi,

I transfered one of my websites to another provider because I was asked
to do that.
The problem I have is it seems like the parameters after the ? are not
readable in the page.
Whereever I make an echo on that page there is nothing happening.
php 5.0.5 is on the server

Is there anyone who can help me?

Best regards,

Geoff

Oct 25 '06 #1
10 1641
Rik
ge************@gmail.com wrote:
Hi,

I transfered one of my websites to another provider because I was
asked to do that.
The problem I have is it seems like the parameters after the ? are not
readable in the page.
Whereever I make an echo on that page there is nothing happening.
php 5.0.5 is on the server

Is there anyone who can help me?
Check register_globals, and print_r($_GET).
Are they there?
--
Rik Wasmus
Oct 25 '06 #2
>
Check register_globals, and print_r($_GET).
Are they there?
--
Rik Wasmus
Yes it is there.

Geoff

Oct 25 '06 #3
Rik
ge************@gmail.com wrote:
>Check register_globals, and print_r($_GET).
Are they there?

Yes it is there.
http://www.php.net/manual/en/securit...terglobals.php
--
Rik Wasmus
Oct 25 '06 #4

Rik wrote:
ge************@gmail.com wrote:
Check register_globals, and print_r($_GET).
Are they there?
Yes it is there.

http://www.php.net/manual/en/securit...terglobals.php
--
Rik Wasmus
Is there a way to get a fast solution?
otherwise i have to change a lot.

Oct 25 '06 #5
Rik
Geoff wrote:
Rik wrote:
>ge************@gmail.com wrote:
>>>Check register_globals, and print_r($_GET).
Are they there?

Yes it is there.

http://www.php.net/manual/en/securit...terglobals.php

Is there a way to get a fast solution?
otherwise i have to change a lot.
I urge you to fix this, but in the mean while:
extract($_GET);
--
Rik Wasmus
Oct 25 '06 #6
>
I urge you to fix this, but in the mean while:
extract($_GET);
--
Rik Wasmus
What is the new way to do this?
I've read through the link you gave me but it isn't completely clear to
me.

Geoff

Oct 25 '06 #7
Rik
Geoff wrote:
>I urge you to fix this, but in the mean while:
extract($_GET);
What is the new way to do this?
I've read through the link you gave me but it isn't completely clear
to me.
1. All variables from a GET request are in the $_GET-array. This will make
sure that they don't 'infect' used variables.
2. When using a $_GET variable, first make sure it's a type you expect.
(for instance:
$id = intval($_GET['id']);//make sure it's an integer
$name = preg_replace('/^[a-z0-9]/i','',$_GET['name']);//only
alphanumeric characters)
3. Use validated variables as you would like.
The main reason is that (sloppy) code with uninitialized variables can be
influenced with either GET or POST request resulting in unexpected and/or
undesireable results. Alwaus make sure you:
a: initiliaze all variables.
b: no outside variables are used for anything without a proper type-check
first.
--
Grtz,

Rik Wasmus
Oct 25 '06 #8
Thank you

Rik wrote:
Geoff wrote:
I urge you to fix this, but in the mean while:
extract($_GET);
What is the new way to do this?
I've read through the link you gave me but it isn't completely clear
to me.

1. All variables from a GET request are in the $_GET-array. This will make
sure that they don't 'infect' used variables.
2. When using a $_GET variable, first make sure it's a type you expect.
(for instance:
$id = intval($_GET['id']);//make sure it's an integer
$name = preg_replace('/^[a-z0-9]/i','',$_GET['name']);//only
alphanumeric characters)
3. Use validated variables as you would like.
The main reason is that (sloppy) code with uninitialized variables can be
influenced with either GET or POST request resulting in unexpected and/or
undesireable results. Alwaus make sure you:
a: initiliaze all variables.
b: no outside variables are used for anything without a proper type-check
first.
--
Grtz,

Rik Wasmus
Oct 25 '06 #9
Geoff wrote:
>I urge you to fix this, but in the mean while:
extract($_GET);
--
Rik Wasmus

What is the new way to do this?
I've read through the link you gave me but it isn't completely clear to
me.

Geoff

Quick and dirty:

Use a text editor to include a script at the very beginning of every php
file:

<?php
include 'extractor.php';
?>

Put this in extractor.php

<?php
if (is_array($_GET))
{
foreach ($_GET as $xxkey =$xxvalue)
{
$$xxkey = $xxvalue;
}
}
?>

(Note: 'xx' is added to the var name to try and keep the var names
unique, otherwise, if you have passed a GET variable with the same name
($key or $value), it would be overwritten by the next iteration of the
foreach.)

This should get you working, but then I advise you to go back and add
some real injection prevention functions at the beginning of routines
that need them.

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*****************************
Oct 25 '06 #10
Chuck Anderson wrote:
Geoff wrote:
>>I urge you to fix this, but in the mean while:
extract($_GET);
--
Rik Wasmus

What is the new way to do this?
I've read through the link you gave me but it isn't completely clear to
me.

Geoff

Quick and dirty:

Use a text editor to include a script at the very beginning of every php
file:

<?php
include 'extractor.php';
?>

Put this in extractor.php

<?php
if (is_array($_GET))
{
foreach ($_GET as $xxkey =$xxvalue)
{
$$xxkey = $xxvalue;
}
}
?>

(Note: 'xx' is added to the var name to try and keep the var names
unique, otherwise, if you have passed a GET variable with the same name
($key or $value), it would be overwritten by the next iteration of the
foreach.)

This should get you working, but then I advise you to go back and add
some real injection prevention functions at the beginning of routines
that need them.
This looks to me like a clumsy way of emulating 'extract($_GET)', as
suggested by Rik. Are you claiming some advantage to doing it this way?

Colin
Oct 29 '06 #11

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

Similar topics

6
by: Philipp Lenssen | last post by:
Is there any way I can keep those URLs... www.example.com/?q=hello&type= from appearing? Let's say I have a form with a select-options box. Along with a single text-input. Now if "q" is the name...
15
by: David Fisher | last post by:
I have been encouraged by someone else to use a reference rather than a pointer as an "out" parameter to a function, eg. void doStuff(Thing &out1, Thing &out2) as opposed to: void...
4
by: Steven T. Hatton | last post by:
#include <iostream> namespace ns{ const char name = "This is a Class Name";//won't compile //char name = "This is a Class Name"; // compiles template <typename T, char* Name_CA=name> struct...
12
by: TTroy | last post by:
For function definitions (not declarations/prototypes), is it necessary to put void in the emptry braces if the function is to receive no parameters? Does this turn any error checking off or cause...
8
by: cody | last post by:
Why doesn't C# allow default parameters for methods? An argument against I hear often is that the default parameters would have to be hardbaken into the assembly, but why? The Jit can take care of...
14
by: Julia | last post by:
Hi, When writing class library do you validate ALL incoming parameters? Is this a good approach,to valid them ALL!!!,and throw exceptions? I realize that if I am not validating them,than my...
21
by: Dmitry Anikin | last post by:
I mean, it's very convenient when default parameters can be in any position, like def a_func(x = 2, y = 1, z): ... (that defaults must go last is really a C++ quirk which is needed for overload...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
5
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.