This is a discussion on Re: [PHP] newbie question regarding URL parameters within the PHP General forums, part of the PHP Programming Forums category; You'll probably get 50 answers to this, but here's probably what happened. There's a setting called "...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
You'll probably get 50 answers to this, but here's probably what happened.
There's a setting called "register globals" that will turn your name=me and age=27 into $name = "me" and $age = "27". It used to be turned ON by default. This was generally considered to be bad security, so it now defaults to OFF. To get these variables, just use the $_GET system variable. $name = $_GET['name']; $age = $_GET['age']; Easy! Best of luck! -TG = = = Original message = = = Hello, I have a newbie question regarding URL parameters. The PHP script I wrote need to read parameters passed in from a URL, so as an example http://my.domain/myscript.php?name=me&age=27 and my script would use $name to get the value for name and $age to get the value for age. Everything was working fine until the sysadmin did a upgrade of the PHP server, and $name and $age both give me nothing. I am just wondering if the latest version of PHP has changed the way to access url parameters. If so, what would be the correct way of doing it? Please help. Thanks. - Jim __________________________________________________ _________ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. |
|
|||
|
At 9:17 PM -0500 1/5/07, <tg-php@gryffyndevelopment.com> wrote:
>You'll probably get 50 answers to this, but here's probably what happened. > >There's a setting called "register globals" that will turn your >name=me and age=27 into $name = "me" and $age = "27". It used to be >turned ON by default. This was generally considered to be bad >security, so it now defaults to OFF. > >To get these variables, just use the $_GET system variable. > >$name = $_GET['name']; >$age = $_GET['age']; > >Easy! > >Best of luck! > >-TG Just to add to -TG advice, you should also clean those inputs. IWO, make sure the values fall within what you expect. Basic security. tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com |
|
|||
|
Wow, there are some really bitchy, unattractive people here. No wonder some
people bail out of IT. Don't confuse knowledge for wisdom. On 1/9/07, tedd <tedd@sperling.com> wrote: > > At 9:17 PM -0500 1/5/07, <tg-php@gryffyndevelopment.com> wrote: > >You'll probably get 50 answers to this, but here's probably what > happened. > > > >There's a setting called "register globals" that will turn your > >name=me and age=27 into $name = "me" and $age = "27". It used to be > >turned ON by default. This was generally considered to be bad > >security, so it now defaults to OFF. > > > >To get these variables, just use the $_GET system variable. > > > >$name = $_GET['name']; > >$age = $_GET['age']; > > > >Easy! > > > >Best of luck! > > > >-TG > > Just to add to -TG advice, you should also clean those inputs. IWO, > make sure the values fall within what you expect. Basic security. > > tedd > -- > ------- > http://sperling.com http://ancientstones.com http://earthstones.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- http://www.web-buddha.co.uk |
|
|||
|
On Tue, 2007-01-09 at 18:41 +0000, Roman Neuhauser wrote:
> # buddhamagnet@gmail.com / 2007-01-09 17:36:55 +0000: > > Wow, there are some really bitchy, unattractive people here. No wonder some > > people bail out of IT. Don't confuse knowledge for wisdom. > > I don't see anything bitchy in the whole email. Don't confuse terseness > with bitching. Who asked you. Now shudup and get back to work. Cheers, Rob. Ps. this has been in jest :B -- ..------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' |
|
|||
|
At 5:36 PM +0000 1/9/07, Dave Goodchild wrote:
>Wow, there are some really bitchy, unattractive people here. No >wonder some people bail out of IT. Don't confuse knowledge for >wisdom. Dave: I don't understand your comment. What I said below is good coding. Never trust any input to be what you expect it to be. An excellent book on this subject is Chirs' book: http://phpsecurity.org/ tedd PS: Nice looking new site Chris ! == previous > >On 1/9/07, tedd <<mailto:tedd@sperling.com>tedd@sperling.com> wrote: > >At 9:17 PM -0500 1/5/07, < ><mailto:tg-php@gryffyndevelopment.com>tg-php@gryffyndevelopment.com> >wrote: >>You'll probably get 50 answers to this, but here's probably what happened. >> >>There's a setting called "register globals" that will turn your >>name=me and age=27 into $name = "me" and $age = "27". It used to be >>turned ON by default. This was generally considered to be bad >>security, so it now defaults to OFF. >> >>To get these variables, just use the $_GET system variable. >> >>$name = $_GET['name']; >>$age = $_GET['age']; >> >>Easy! >> >>Best of luck! >> >>-TG > >Just to add to -TG advice, you should also clean those inputs. IWO, >make sure the values fall within what you expect. Basic security. > >tedd >-- >------- ><http://sperling.com>http://sperling.com > <http://ancientstones.com>http://ancientstones.com <http://earthstones.com>http://earthstones.com > >-- >PHP General Mailing List (<http://www.php.net/>http://www.php.net/) >To unsubscribe, visit: ><http://www.php.net/unsub.php>http://www.php.net/unsub.php > > > > >-- ><http://www.web-buddha.co.uk>http://www.web-buddha.co.uk -- ------- http://sperling.com http://ancientstones.com http://earthstones.com |
|
|||
|
# buddhamagnet@gmail.com / 2007-01-09 17:36:55 +0000:
> Wow, there are some really bitchy, unattractive people here. No wonder some > people bail out of IT. Don't confuse knowledge for wisdom. I don't see anything bitchy in the whole email. Don't confuse terseness with bitching. Oh, and also don't top-post, thanks. > On 1/9/07, tedd <tedd@sperling.com> wrote: > > > >At 9:17 PM -0500 1/5/07, <tg-php@gryffyndevelopment.com> wrote: > >>You'll probably get 50 answers to this, but here's probably what > >happened. > >> > >>There's a setting called "register globals" that will turn your > >>name=me and age=27 into $name = "me" and $age = "27". It used to be > >>turned ON by default. This was generally considered to be bad > >>security, so it now defaults to OFF. > >> > >>To get these variables, just use the $_GET system variable. > >> > >>$name = $_GET['name']; > >>$age = $_GET['age']; > >> > >>Easy! > >> > >>Best of luck! > >> > >>-TG > > > >Just to add to -TG advice, you should also clean those inputs. IWO, > >make sure the values fall within what you expect. Basic security. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 |
|
|||
|
Dave Goodchild wrote:
> Wow, there are some really bitchy, unattractive people here. No wonder some not to mention some very judgemental people as well. :-) it's pretty funny that someone who purports to aspire to buddhahood is so stuck in complaining about other people's bitchiness and unattractiveness. thanks for the smile, Dave. [buddha has thicker skin, and his feet are dirty.] I wouldn't bother with a hypocracy argument in reply - I already know about my own hypocracy. :-) > people bail out of IT. most people bail out of IT because of the peanuts being paid, the completely ungrateful management they work for, the crazy hours their expected to work and the severe lack of goodlooking women walking around in the average data bunker. selling crack, making porn & writing a few rap lyrics is so much easier - just ask SnoopDog. > Don't confuse knowledge for wisdom. whoahoo, a racecar heh? > > On 1/9/07, tedd <tedd@sperling.com> wrote: >> >> At 9:17 PM -0500 1/5/07, <tg-php@gryffyndevelopment.com> wrote: >> >You'll probably get 50 answers to this, but here's probably what >> happened. >> > >> >There's a setting called "register globals" that will turn your >> >name=me and age=27 into $name = "me" and $age = "27". It used to be >> >turned ON by default. This was generally considered to be bad >> >security, so it now defaults to OFF. >> > >> >To get these variables, just use the $_GET system variable. >> > >> >$name = $_GET['name']; >> >$age = $_GET['age']; >> > >> >Easy! >> > >> >Best of luck! >> > >> >-TG >> >> Just to add to -TG advice, you should also clean those inputs. IWO, >> make sure the values fall within what you expect. Basic security. >> >> tedd >> -- >> ------- >> http://sperling.com http://ancientstones.com http://earthstones.com >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > |