Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 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 March 10th, 2005, 10:57 AM
Registered User
 
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tanvir_math Send a message via Yahoo to tanvir_math
Default does not work register.php in ch 11 begining php5

hello every body, i am continuously having problem with chaptar 11
register.php. i am using iis in xp. i can connect with my mysql
database named "sample_db". user name "phpuser" and password "phppass"
though i have copied all files from chapter11 source folder to wwwroot.
 i can open the file register.php without having any problem. but when i give some input and press submit, nothing have happened. no error message or confirmation of creating the user. i also submit the page without filling any input field. thus a error page should be displayed. but nothing happens. what can i do now? could any body please help me?
please. i am looking forward to someone's help. please help me.
 
Old September 10th, 2005, 03:17 AM
Registered User
 
Join Date: Sep 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My solution at your problem is to add, before the last "switch" code, this:

else $_POST['action'] = "register";

Infact this specify another condition of "action".

With this code I have resolved this problem, that It was been my problem too.

Bye



 
Old December 22nd, 2006, 10:10 AM
Registered User
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

stefanocinfo has overcome the problem by changing the way the switch works. He's saying if there is $_POST['action'] then it must be "register". That's OK in this case but in a more general case there could be more than one value for $_POST['action'] so more than one case within the switch.

The real cause of the problem is on page 436 - two lines from the bottom:
<input type="hidden" name="action">
this sets $_POST['action'] but leaves the value NULL
it should be
<input type="hidden" name="action" value="register">



 
Old February 7th, 2007, 05:03 PM
Registered User
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Me too... I have a problem here in Chapter 11 in Beginning PHP5. Every I execute the sample code of the chapter it will appear an error message, states that there was an error in this code.:

<?php
for($i=0; $i < count($position_array); $i++){
   if(!isset($userposition) && $i == 0){
     echo "<OPTION SELECTED VALUE=\"". $position_array[$i] . "\">" . $position_array[$i] . "</OPTION>\n";
   }else if($position == $cposition_array[$i]){
     echo "<OPTION SELECTED VALUE=\"". $position_array[$i] . "\">" . $position_array[$i] . "</OPTION>\n";
   }else{
     echo "<OPTION VALUE=\"". $position_array[$i] . "\">" . $position_array[$i] . "</OPTION>\n";
   }
}
?>






Similar Threads
Thread Thread Starter Forum Replies Last Post
begining PHP, input box dungey Beginning PHP 11 February 28th, 2012 07:03 AM
PHP5: Ch 3, p. 102-105 JaneDean BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 January 31st, 2007 02:15 PM
Beg. PHP 5 > Ch. 11 - fetch_field.php crater BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 January 2nd, 2007 12:20 PM
Ch 15 Register.asp query daveyarwood BOOK: Beginning ASP 3.0 0 July 16th, 2005 12:52 PM
Example 4 Ch 5 -Begining JavaScript flyn Javascript How-To 4 November 27th, 2003 04:35 AM





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