Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old December 19th, 2003, 01:45 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default


First of all, $_POST is not a command, it's a variable, just like $choice is. That said, you should be able to do anything with $_POST['...'] as you can with $choice.

Second, 'choice1' is the index into the $_POST array. If you add <br> to that string, you're attempting to access a comletely different index. By index here, I mean that $_POST is a structure that allows you to associate a value with a name. The name of your values are 'choice1', 'choice2', and 'choice3'. There are no values named 'choice1<br>', which is why you get nothing.


Simple answer:

echo $_POST['choice1'] . "<br>";

   OR

echo "$_POST[choice1]<br>";

  OR (as I prefer:)

echo "{$_POST['choice1']}<br>";


For more info on variable substitution and string parsing, read the manual:
  http://www.php.net/types.string



Take care,

Nik
http://www.bigaction.org/
Reply With Quote
  #12 (permalink)  
Old February 28th, 2012, 07:03 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default As above

Along with the suggestions above, although it takes longer, you can also separate the code onto multiple lines.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
INPUT BOX IN ASP/VBSCRIPT chinedu Classic ASP Basics 8 February 15th, 2007 02:47 PM
does not work register.php in ch 11 begining php5 tanvir_math BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 February 7th, 2007 05:03 PM
Input Box return value pakman Excel VBA 1 June 15th, 2005 04:29 AM
Input Box tucker Access VBA 2 May 21st, 2004 03:43 PM
Double search using an input text box Karel Access VBA 2 October 25th, 2003 10:29 PM



All times are GMT -4. The time now is 09:02 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.