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
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
  #1 (permalink)  
Old April 18th, 2006, 06:03 AM
Registered User
 
Join Date: Apr 2006
Location: , , Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Book: Beginning PHP 4

Hi there guys,
I'm following the steps of the book "Beginning PHP 4", but some things aren't working. In the 3rd chapter, the author makes a checkbox in HTML, named 'choice'. In the PHP file, he simply echo the $choice, without making any variable before. It doesn't work for me and I don't know why.
In order to echo the same variable I have to grab the value of the checkbox ($_POST), attribute it to the variable, and then echo it.
Am I missing something? Or maybe working with the wrong version, 'cause the book is PHP4 and I'm working with PHP5.
Well, hope it's not a drama, 'cause I'm really interested in carry on going with this book :)

Thanx,
Perroud
Reply With Quote
  #2 (permalink)  
Old April 19th, 2006, 04:46 PM
Authorized User
 
Join Date: Mar 2004
Location: , , Latvia.
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It may be the globals problem.

It is more safe to use $_POST variable to operate with user input so that's why it is recommended. Just echo $_POST ['choice'].

All $_POST sub-variables, if we can call them like this, are accessible separately (not only as $_POST or $_REQUEST or $GLOBALS array values) depending on a specific switch set in "php.ini". IIRC, in PHP4 has it switched on, but in PHP5 they made it off by default.

So, instead of changing that switch I suggest you simply use the global arrays instead.

Janis

Reply With Quote
  #3 (permalink)  
Old April 19th, 2006, 11:43 PM
Registered User
 
Join Date: Apr 2006
Location: yangon, yangon, Myanmar (Burma).
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ayethe
Default

Hello!
I am starting studying php at April 10.
So I want to know beginning and want to do web page.
What can i do ?
How do i study?
At home I indtall aprache server,php 4.5.0 and MySQL.
In my job,I will use php.
So help me to do.


Aye The

thaw
Reply With Quote
  #4 (permalink)  
Old April 21st, 2006, 09:03 AM
Registered User
 
Join Date: Apr 2006
Location: , , Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Janis, I will follow your advise and leave the php.ini alone. I'm fixing up the examples of the book, and it's working. It takes a bit longer, but it's ok. Let's see how it goes :)

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
finding free book "Beginning Jsp Book" ruzdi JSP Basics 0 December 7th, 2007 01:46 PM
Commit.PHP and Delete.PHP in WROX's book GiFos Beginning PHP 0 January 30th, 2007 10:51 PM
Problem with book Beginning PHP, Apache, Mysql WD elals BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 December 9th, 2005 02:39 AM
Problem with book Beginning PHP, Apache, Mysql WD elals Beginning PHP 1 March 27th, 2005 10:02 AM
Beginning PHP: CH17, PHP Directory cyberjacky Beginning PHP 1 March 12th, 2004 11:39 AM



All times are GMT -4. The time now is 05:22 PM.


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