Re: [PHP] Problem about Reading input from a Form

2002-02-25 Thread Stewart G.


OK, Im an idiot, glad I caught myself before someone else did. I didnt see 
the PHP print statments. :)

Follow mikes advice on the register globals, and restarting the server. Or 
try using $HTTP_POST_VARS['user'] or $_POST['user'].

-- Stewart

On Mon, 25 Feb 2002, Stewart G. wrote:

> Its not a register_globals issue. You must wrap $user and $address in php 
> print statements rather than just in the html.
> 
> Your name is .
> Your address is .
> 
> That will work with either GET or POST.
> 
> -- Stewart
> 
> On Mon, 25 Feb 2002, Kostas Karadamoglou wrote:
> 
> > I set the register_globals On in the php.ini file but when i do php.info it 
> > shows that is off.About the better way, How i can manipulate this variables, 
> > can you give me an exable.
> > Thank you
> > 
> > 
> > >From: "Ford, Mike   [LSS]" <[EMAIL PROTECTED]>
> > >To: 'Kostas Karadamoglou' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> > >Subject: RE: [PHP] Problem about Reading input from a Form
> > >Date: Mon, 25 Feb 2002 14:30:09 -
> > >
> > > > -Original Message-
> > > > From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
> > > > Sent: 25 February 2002 14:09
> > > >
> > > > I put and the POST method but I have the same problem
> > > > I don't know why, any ideas?
> > > > Thank you
> > > >
> > > > >
> > > > >-Original Message-
> > > > >From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
> > > > >Sent: Monday, February 25, 2002 12:58 PM
> > > > >
> > > > >I can't take the variables $user and $address from the form
> > > > to the php
> > > > >file.
> > >
> > >Which version of PHP?  Is register_globals set to Off?  If it is, you can 
> > >either turn it On (if you have control of the server), or (better!) use the 
> > >$HTTP_POST_VARS (4.0) or $_POST (4.1) array.
> > >
> > >Cheers!
> > >
> > >Mike
> > >
> > >-
> > >Mike Ford,  Electronic Information Services Adviser,
> > >Learning Support Services, Learning & Information Services,
> > >JG125, James Graham Building, Leeds Metropolitan University,
> > >Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> > >Email: [EMAIL PROTECTED]
> > >Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
> > 
> > 
> > 
> > 
> > _
> > Send and receive Hotmail on your mobile device: http://mobile.msn.com
> > 
> > 
> > 
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Problem about Reading input from a Form

2002-02-25 Thread Ford, Mike [LSS]

> -Original Message-
> From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
> Sent: 25 February 2002 14:35
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] Problem about Reading input from a Form
> 
> 
> I set the register_globals On in the php.ini file but when i 
> do php.info it 
> shows that is off.

Did you restart PHP after changing php.ini?

>  About the better way, How i can manipulate 
> this variables, 
> can you give me an exable.

Simple: instead of $user and $address, use:

* in PHP 4.0: $HTTP_POST_VARS['user'] and $HTTP_POST_VARS['address']
* in PHP 4.1: $_POST['user'] and $_POST['address']

For more information, refer to 
http://www.php.net/manual/en/language.variables.external.php (which doesn't actually 
mention the $_* variables), and 
http://www.php.net/manual/en/language.variables.predefined.php (scroll waaay down 
until you reach the heading "PHP variables").

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem about Reading input from a Form

2002-02-25 Thread Stewart G.

Its not a register_globals issue. You must wrap $user and $address in php 
print statements rather than just in the html.

Your name is .
Your address is .

That will work with either GET or POST.

-- Stewart

On Mon, 25 Feb 2002, Kostas Karadamoglou wrote:

> I set the register_globals On in the php.ini file but when i do php.info it 
> shows that is off.About the better way, How i can manipulate this variables, 
> can you give me an exable.
> Thank you
> 
> 
> >From: "Ford, Mike   [LSS]" <[EMAIL PROTECTED]>
> >To: 'Kostas Karadamoglou' <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> >Subject: RE: [PHP] Problem about Reading input from a Form
> >Date: Mon, 25 Feb 2002 14:30:09 -
> >
> > > -Original Message-
> > > From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
> > > Sent: 25 February 2002 14:09
> > >
> > > I put and the POST method but I have the same problem
> > > I don't know why, any ideas?
> > > Thank you
> > >
> > > >
> > > >-Original Message-
> > > >From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
> > > >Sent: Monday, February 25, 2002 12:58 PM
> > > >
> > > >I can't take the variables $user and $address from the form
> > > to the php
> > > >file.
> >
> >Which version of PHP?  Is register_globals set to Off?  If it is, you can 
> >either turn it On (if you have control of the server), or (better!) use the 
> >$HTTP_POST_VARS (4.0) or $_POST (4.1) array.
> >
> >Cheers!
> >
> >Mike
> >
> >-
> >Mike Ford,  Electronic Information Services Adviser,
> >Learning Support Services, Learning & Information Services,
> >JG125, James Graham Building, Leeds Metropolitan University,
> >Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> >Email: [EMAIL PROTECTED]
> >Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211
> 
> 
> 
> 
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Problem about Reading input from a Form

2002-02-25 Thread Ford, Mike [LSS]

> -Original Message-
> From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
> Sent: 25 February 2002 14:09
> 
> I put and the POST method but I have the same problem
> I don't know why, any ideas?
> Thank you
> 
> >
> >-Original Message-
> >From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
> >Sent: Monday, February 25, 2002 12:58 PM
> >
> >I can't take the variables $user and $address from the form 
> to the php
> >file.

Which version of PHP?  Is register_globals set to Off?  If it is, you can either turn 
it On (if you have control of the server), or (better!) use the $HTTP_POST_VARS (4.0) 
or $_POST (4.1) array.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Problem about Reading input from a Form

2002-02-25 Thread Matt Williams

On Monday 25 February 2002 12:57, Kostas Karadamoglou wrote:
> I can't take the variables $user and $address from the form to the php
> file. Below I have the code.When I test the examble I only see the html
> text but not the variables. Thank you
>

Whic version of PHP are you using? If it's 4.1 I think php ships with 
register_globals off.

I think you have to access your variables with $_GET & $_POST. I'm not too 
sure as I haven't upgraded yet.

m:


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Problem about Reading input from a Form

2002-02-25 Thread John Day

You need to add the POST method to your form tag 



Cheers
JD


-Original Message-
From: Kostas Karadamoglou [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 25, 2002 12:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem about Reading input from a Form


I can't take the variables $user and $address from the form to the php
file. 
Below I have the code.When I test the examble I only see the html text
but 
not the variables. Thank you

THE HTML FORM


Listing 9.2 














THE PROCCESS OF THE INPUT FORM


Listing 9.3 


$user\n\n";
print "Your address is:\n\n$address";
?>



The files are in the same directory

_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php