newbie question regarding URL parameters

This is a discussion on newbie question regarding URL parameters within the PHP General forums, part of the PHP Programming Forums category; Hello, I have a newbie question regarding URL parameters. The PHP script I wrote need to read parameters passed in ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-06-2007
Jim the Standing Bear
 
Posts: n/a
Default newbie question regarding URL parameters

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
Reply With Quote
  #2 (permalink)  
Old 01-06-2007
Nicholas Yim
 
Posts: n/a
Default Re: [PHP] newbie question regarding URL parameters

Hello Jim the Standing Bear,

register_global

try use
$name=$_GET['name'];
$age=$_GET['age'];

Best regards,

======= At 2007-01-06, 10:05:40 you wrote: =======

>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
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>


= = = = = = = = = = = = = = = = = = = =

Nicholas Yim
nick.yim@taowap.com
2007-01-06
Reply With Quote
  #3 (permalink)  
Old 01-06-2007
Robert Cummings
 
Posts: n/a
Default Re: [PHP] newbie question regarding URL parameters

On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote:
> 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

^^^^^^^^^^^^^^^^^^^^^

Ummm, pull your head out of the sand (or whatever other dark recess you
have it stuck in). Register globals ini setting was defaulted to "off"
about 3 or more years ago :/

Cheers,
Rob.
--
..------------------------------------------------------------.
| 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. |
`------------------------------------------------------------'
Reply With Quote
  #4 (permalink)  
Old 01-06-2007
Jim the Standing Bear
 
Posts: n/a
Default Re: [PHP] newbie question regarding URL parameters

Thanks, everyone. Yeah, I really need to dig myself out of the sand. :D

On 1/5/07, Robert Cummings <robert@interjinn.com> wrote:
> On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote:
> > 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

> ^^^^^^^^^^^^^^^^^^^^^
>
> Ummm, pull your head out of the sand (or whatever other dark recess you
> have it stuck in). Register globals ini setting was defaulted to "off"
> about 3 or more years ago :/
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | 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. |
> `------------------------------------------------------------'
>
>



--
--------------------------------------
Standing Bear Has Spoken
--------------------------------------
Reply With Quote
  #5 (permalink)  
Old 01-06-2007
Ryan Fielding
 
Posts: n/a
Default Re: [PHP] newbie question regarding URL parameters

Robert Cummings wrote:
> On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote:
>
>> 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
>>

> ^^^^^^^^^^^^^^^^^^^^^
>
> Ummm, pull your head out of the sand (or whatever other dark recess you
> have it stuck in). Register globals ini setting was defaulted to "off"
> about 3 or more years ago :/
>
> Cheers,
> Rob.
>

Mate is this kind of behaviour really neccesary? Some people don't know
everything that you do, and he has already stated he isn't responsible
for administering the server.
Reply With Quote
  #6 (permalink)  
Old 01-06-2007
Robert Cummings
 
Posts: n/a
Default Re: [PHP] newbie question regarding URL parameters

On Sat, 2007-01-06 at 13:31 +1100, Ryan Fielding wrote:
> Robert Cummings wrote:
> > On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote:
> >
> >> 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
> >>

> > ^^^^^^^^^^^^^^^^^^^^^
> >
> > Ummm, pull your head out of the sand (or whatever other dark recess you
> > have it stuck in). Register globals ini setting was defaulted to "off"
> > about 3 or more years ago :/
> >
> > Cheers,
> > Rob.
> >


> Mate is this kind of behaviour really neccesary?


I'm leaning towards yes.

> Some people don't know everything that you do


I don't know everything either, but register globals has been covered
here in depth for the entire length of time since the default value was
switched. There's this thing called the archives. There's also this
thing called "knowing the technology you use".

> and he has already stated he isn't responsible for administering the
> server.


Not responsible for administering the server is fine, but php.ini is
part of PHP and he did state he wrote the script. If you're suggesting a
PHP developer shouldn't need to be aware of the associated ini
configuration (regardless of whether they can admin it) then you also
need to get your head out of the sand.

Cheers,
Rob.
--
..------------------------------------------------------------.
| 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. |
`------------------------------------------------------------'
Reply With Quote
  #7 (permalink)  
Old 01-08-2007
Moses
 
Posts: n/a
Default Re: newbie question regarding URL parameters

There's also such a thing as 'being a complete arse'.

This guy was clearly new to php, and was just asking for a bit of help.
Give him a break. We are not all born knowing how to configure php.ini
files - it's something you learn incrementally.

Don't be such an arse.


Robert Cummings wrote:
> On Sat, 2007-01-06 at 13:31 +1100, Ryan Fielding wrote:
> > Robert Cummings wrote:
> > > On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote:
> > >
> > >> 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
> > >>
> > > ^^^^^^^^^^^^^^^^^^^^^
> > >
> > > Ummm, pull your head out of the sand (or whatever other dark recess you
> > > have it stuck in). Register globals ini setting was defaulted to "off"
> > > about 3 or more years ago :/
> > >
> > > Cheers,
> > > Rob.
> > >

>
> > Mate is this kind of behaviour really neccesary?

>
> I'm leaning towards yes.
>
> > Some people don't know everything that you do

>
> I don't know everything either, but register globals has been covered
> here in depth for the entire length of time since the default value was
> switched. There's this thing called the archives. There's also this
> thing called "knowing the technology you use".
>
> > and he has already stated he isn't responsible for administering the
> > server.

>
> Not responsible for administering the server is fine, but php.ini is
> part of PHP and he did state he wrote the script. If you're suggesting a
> PHP developer shouldn't need to be aware of the associated ini
> configuration (regardless of whether they can admin it) then you also
> need to get your head out of the sand.
>
> Cheers,
> Rob.
> --
> .------------------------------------------------------------.
> | 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. |
> `------------------------------------------------------------'


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:01 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0