Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2006, 06:03 AM
Registered User
 
Join Date: Apr 2006
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
 
Old April 19th, 2006, 04:46 PM
Authorized User
 
Join Date: Mar 2004
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

 
Old April 19th, 2006, 11:43 PM
Registered User
 
Join Date: Apr 2006
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
 
Old April 21st, 2006, 09:03 AM
Registered User
 
Join Date: Apr 2006
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 :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.