RE: [PHP] combining text with $_POST
Hi all, how can I combine this line to use just 1 echo statement? echo Name: ; echo $_POST['name'] The period is used for string concatenation: echo Name: . $_POST['name']; Many ways you can do it: echo Name: {$_POST['name']}; echo 'Name: ' . $_POST['name']; echo Name: $_POST[name]; echo 'Name: ' . $_POST[name]; etc... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] combining text with $_POST
On 06-Apr-2003 David McGlone wrote: Hi all, how can I combine this line to use just 1 echo statement? echo Name: ; echo $_POST['name'] echo 'Name: ', $_POST['name']; -or- echo 'Name: ' .$_POST['name']; Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] combining text with $_POST
On Saturday 05 April 2003 08:00 pm, John W. Holmes wrote: Hi all, how can I combine this line to use just 1 echo statement? echo Name: ; echo $_POST['name'] The period is used for string concatenation: echo Name: . $_POST['name']; Many ways you can do it: echo Name: {$_POST['name']}; echo 'Name: ' . $_POST['name']; echo Name: $_POST[name]; echo 'Name: ' . $_POST[name]; etc... Thank you all for the quick response. I was using this method and now I finally see my error which was I forgot to put the . before $_POST As you all can see, im relativly new to PHP and I think I'll thank you all for putting up with me now instead of later.. : - ) -- David M. Edification Web Solutions http://www.edificationweb.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] combining text with $_POST
you also really don't need single quotes in the $_POST... echo Name: $_POST[name]; .. should work. cheers, - Sebastian - Original Message - From: Don Read [EMAIL PROTECTED] | | On 06-Apr-2003 David McGlone wrote: | Hi all, how can I combine this line to use just 1 echo statement? | | echo Name: ; echo $_POST['name'] | | | echo 'Name: ', $_POST['name']; | | -or- | | echo 'Name: ' .$_POST['name']; | | | Regards, | -- | Don Read [EMAIL PROTECTED] | -- It's always darkest before the dawn. So if you are going to |steal the neighbor's newspaper, that's the time to do it. | | -- | 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] combining text with $_POST
you also really don't need single quotes in the $_POST... (if the variable is within a string delimited by _double_ quotes) echo Name: $_POST[name]; .. should work. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php