RE: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-11 Thread Ford, Mike [LSS]
> - Original Message - 
> From: "Victor" <[EMAIL PROTECTED]>
> To: "'Rick Emery'" <[EMAIL PROTECTED]>
> Sent: Tuesday, December 10, 2002 1:49 PM
> Subject: RE: [PHP] Re: Help please: Unable to get 
> $_POST["variable"]; to work in a form.
> 
> 
> Why are you using $_POST[""]? I thought you had to use $_POST['']. I
> always use '' instead of "" and it always works. Is it just 
> me? Can one
> really use double quotes? 

Of course you can -- it's just a string!  The difference, as with all
strings, is in whether you want variable names to be interpolated or not.
Consider:

   $num = 3;
   $array = array('var 3'=>'Interpolated!', 'var $nuum'=>'Not
Interpolated');
   echo $array['var $num'];// => Not Interpolated
   echo $array["var $num"];// => Interpolated!
   echo $array['var '.$num];   // => Interpolated!

Of course, an arrray subscript can be any expression, so to go to extremes I
could even do something like:

   $x = 1;
   $y = 2;
   $a = 'a';

   echo $array['v'.$a."r ".($x+$y)];   // => Interpolated!

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] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread Rick Emery
First, please respond to the list, not me.

Second, I'm not asking the question, David Scott is.

Third, I don't use " " either; I use ' '
- Original Message - 
From: "Victor" <[EMAIL PROTECTED]>
To: "'Rick Emery'" <[EMAIL PROTECTED]>
Sent: Tuesday, December 10, 2002 1:49 PM
Subject: RE: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a 
form.


Why are you using $_POST[""]? I thought you had to use $_POST['']. I
always use '' instead of "" and it always works. Is it just me? Can one
really use double quotes? 

-Original Message-----
From: Rick Emery [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 10, 2002 2:05 PM
To: 
Subject: Fw: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
work in a form.

What version of PHP are you using?  I believe that anything earlier than
4.05 does not
support $_POST.

Did you try $HTTP_POST_VARS['name']?  This will work, regardless of
version.

----- Original Message -----
From: "David Scott" <[EMAIL PROTECTED]>
To: <>
Sent: Tuesday, December 10, 2002 12:54 PM
Subject: Re: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
work in a form.


I have corrected the typo and had hoped this was a simple solution, yet
$_POST still doesn't work. Any ideas?

"Craig Thomas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Using $_REQUEST[""] works because the vars are in the http request,
but
> $_POST[""] contains nothing as the other poster noted:  mehtod="post"
>
> >>-Original Message-
> >>From: David Scott [mailto:[EMAIL PROTECTED]]
> >>Sent: Tuesday, December 10, 2002 1:20 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
> >>work in a form.
> >>
> >>
> >>Using $_REQUEST["variable"] causes the script to work.
> >>Why is this? And, why can I not use $_POST?
> >>
> >>"David Scott" <[EMAIL PROTECTED]> wrote in message
> >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>> I am going through the introductory tutorial on
> >>http://www.php.net/ and am
> >>> stuck on this page:
> >>> http://www.php.net/manual/en/tutorial.forms.php
> >>>
> >>> I have been able to get all of the examples up to this point to
work.
> >>>
> >>> The form is simple: it asks for a text "name", a text "age" and
has a
> >>submit
> >>> button. The information is submitted to action.php.
> >>>
> >>> Action.php contains this code:
> >>> Hi .
> >>> You are  years old.
> >>>
> >>> I saved action.php as a text file with only the information above.
> >>>
> >>> When I enter JoeBob into the name field and 27 into the age field,
I
get
> >>> this for output:
> >>> Hi
> >>> Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on
line
1
> >>> . You are
> >>> Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on
line
2
> >>> years old.
> >>>
> >>> What can I do to remedy this?
> >>>
> >>>
> >>
> >>
> >>
> >>--
> >>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




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

__ 
Post your free ad now! http://personals.yahoo.ca



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




Fw: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread Rick Emery
What version of PHP are you using?  I believe that anything earlier than 4.05 does not
support $_POST.

Did you try $HTTP_POST_VARS['name']?  This will work, regardless of version.

- Original Message -
From: "David Scott" <[EMAIL PROTECTED]>
To: <>
Sent: Tuesday, December 10, 2002 12:54 PM
Subject: Re: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a 
form.


I have corrected the typo and had hoped this was a simple solution, yet
$_POST still doesn't work. Any ideas?

"Craig Thomas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Using $_REQUEST[""] works because the vars are in the http request, but
> $_POST[""] contains nothing as the other poster noted:  mehtod="post"
>
> >>-Original Message-
> >>From: David Scott [mailto:[EMAIL PROTECTED]]
> >>Sent: Tuesday, December 10, 2002 1:20 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
> >>work in a form.
> >>
> >>
> >>Using $_REQUEST["variable"] causes the script to work.
> >>Why is this? And, why can I not use $_POST?
> >>
> >>"David Scott" <[EMAIL PROTECTED]> wrote in message
> >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>> I am going through the introductory tutorial on
> >>http://www.php.net/ and am
> >>> stuck on this page:
> >>> http://www.php.net/manual/en/tutorial.forms.php
> >>>
> >>> I have been able to get all of the examples up to this point to work.
> >>>
> >>> The form is simple: it asks for a text "name", a text "age" and has a
> >>submit
> >>> button. The information is submitted to action.php.
> >>>
> >>> Action.php contains this code:
> >>> Hi .
> >>> You are  years old.
> >>>
> >>> I saved action.php as a text file with only the information above.
> >>>
> >>> When I enter JoeBob into the name field and 27 into the age field, I
get
> >>> this for output:
> >>> Hi
> >>> Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line
1
> >>> . You are
> >>> Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line
2
> >>> years old.
> >>>
> >>> What can I do to remedy this?
> >>>
> >>>
> >>
> >>
> >>
> >>--
> >>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




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




Re: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread David Scott
I have corrected the typo and had hoped this was a simple solution, yet
$_POST still doesn't work. Any ideas?

"Craig Thomas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Using $_REQUEST[""] works because the vars are in the http request, but
> $_POST[""] contains nothing as the other poster noted:  mehtod="post"
>
> >>-Original Message-
> >>From: David Scott [mailto:[EMAIL PROTECTED]]
> >>Sent: Tuesday, December 10, 2002 1:20 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
> >>work in a form.
> >>
> >>
> >>Using $_REQUEST["variable"] causes the script to work.
> >>Why is this? And, why can I not use $_POST?
> >>
> >>"David Scott" <[EMAIL PROTECTED]> wrote in message
> >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >>> I am going through the introductory tutorial on
> >>http://www.php.net/ and am
> >>> stuck on this page:
> >>> http://www.php.net/manual/en/tutorial.forms.php
> >>>
> >>> I have been able to get all of the examples up to this point to work.
> >>>
> >>> The form is simple: it asks for a text "name", a text "age" and has a
> >>submit
> >>> button. The information is submitted to action.php.
> >>>
> >>> Action.php contains this code:
> >>> Hi .
> >>> You are  years old.
> >>>
> >>> I saved action.php as a text file with only the information above.
> >>>
> >>> When I enter JoeBob into the name field and 27 into the age field, I
get
> >>> this for output:
> >>> Hi
> >>> Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line
1
> >>> . You are
> >>> Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line
2
> >>> years old.
> >>>
> >>> What can I do to remedy this?
> >>>
> >>>
> >>
> >>
> >>
> >>--
> >>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




RE: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread Craig Thomas
Using $_REQUEST[""] works because the vars are in the http request, but
$_POST[""] contains nothing as the other poster noted:  mehtod="post"

>>-Original Message-
>>From: David Scott [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, December 10, 2002 1:20 PM
>>To: [EMAIL PROTECTED]
>>Subject: [PHP] Re: Help please: Unable to get $_POST["variable"]; to
>>work in a form.
>>
>>
>>Using $_REQUEST["variable"] causes the script to work.
>>Why is this? And, why can I not use $_POST?
>>
>>"David Scott" <[EMAIL PROTECTED]> wrote in message
>>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>> I am going through the introductory tutorial on
>>http://www.php.net/ and am
>>> stuck on this page:
>>> http://www.php.net/manual/en/tutorial.forms.php
>>>
>>> I have been able to get all of the examples up to this point to work.
>>>
>>> The form is simple: it asks for a text "name", a text "age" and has a
>>submit
>>> button. The information is submitted to action.php.
>>>
>>> Action.php contains this code:
>>> Hi .
>>> You are  years old.
>>>
>>> I saved action.php as a text file with only the information above.
>>>
>>> When I enter JoeBob into the name field and 27 into the age field, I get
>>> this for output:
>>> Hi
>>> Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1
>>> . You are
>>> Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2
>>> years old.
>>>
>>> What can I do to remedy this?
>>>
>>>
>>
>>
>>
>>--
>>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




[PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread David Scott
Using $_REQUEST["variable"] causes the script to work.
Why is this? And, why can I not use $_POST?

"David Scott" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am going through the introductory tutorial on http://www.php.net/ and am
> stuck on this page:
> http://www.php.net/manual/en/tutorial.forms.php
>
> I have been able to get all of the examples up to this point to work.
>
> The form is simple: it asks for a text "name", a text "age" and has a
submit
> button. The information is submitted to action.php.
>
> Action.php contains this code:
> Hi .
> You are  years old.
>
> I saved action.php as a text file with only the information above.
>
> When I enter JoeBob into the name field and 27 into the age field, I get
> this for output:
> Hi
> Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1
> . You are
> Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2
> years old.
>
> What can I do to remedy this?
>
>



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




[PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread Rodney Green



the word METHOD is incorrectly spelled.







This is the exact code in the HTML file:


 
  PHP Form Example
 


 Your name: 
 Your age: 
 




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




[PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread David Scott
This is the exact code in the HTML file:


 
  PHP Form Example
 


 Your name: 
 Your age: 
 




I believe that is using the method POST. If there is something wrong in the
HTML file, or if you have any other suggestions, then please let me know.

"Hacook" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Make sure your form is sent through the method="POST"
>
> "David Scott" <[EMAIL PROTECTED]> a écrit dans le message de news:
> [EMAIL PROTECTED]
> > I am going through the introductory tutorial on http://www.php.net/ and
am
> > stuck on this page:
> > http://www.php.net/manual/en/tutorial.forms.php
> >
> > I have been able to get all of the examples up to this point to work.
> >
> > The form is simple: it asks for a text "name", a text "age" and has a
> submit
> > button. The information is submitted to action.php.
> >
> > Action.php contains this code:
> > Hi .
> > You are  years old.
> >
> > I saved action.php as a text file with only the information above.
> >
> > When I enter JoeBob into the name field and 27 into the age field, I get
> > this for output:
> > Hi
> > Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1
> > . You are
> > Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2
> > years old.
> >
> > What can I do to remedy this?
> >
> >
>
>



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




[PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.

2002-12-10 Thread hacook
Make sure your form is sent through the method="POST"

"David Scott" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> I am going through the introductory tutorial on http://www.php.net/ and am
> stuck on this page:
> http://www.php.net/manual/en/tutorial.forms.php
>
> I have been able to get all of the examples up to this point to work.
>
> The form is simple: it asks for a text "name", a text "age" and has a
submit
> button. The information is submitted to action.php.
>
> Action.php contains this code:
> Hi .
> You are  years old.
>
> I saved action.php as a text file with only the information above.
>
> When I enter JoeBob into the name field and 27 into the age field, I get
> this for output:
> Hi
> Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1
> . You are
> Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2
> years old.
>
> What can I do to remedy this?
>
>



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