 |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6  | This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 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
|
|
|
|

July 14th, 2006, 12:05 AM
|
|
Registered User
|
|
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chapter 5 page 151
Hi guys,
Need your help here. I get this error on chapter 5 page 151
Notice: Undefined index: step in /var/www/debian.com/public_html/movie/form4.php on line 19
Code as downloaded from the site:
<?php
// Debug info Display
function debugDisplay(){
?>
<PRE>
$_POST
<?php
print_r($_POST);
?>
$_GET
<?php
print_r($_GET);
?>
</PRE>
<?php
}
// Switch on search/add wizard step
switch( $_GET['step']){
// #################
// Search/Add form
// #################
case "1":
$type = explode(":",$_POST['type']);
if ($_POST['Submit']=="Add"){
require($_POST['Submit'].$type[0].'.php');
} else {
if ( $_POST['type'] == "Movie:Movie" &&
$_POST['MovieType'] == ""){
header("Location:form4.php");
}
?>
<h1>Search Results</h1>
<p>You are looking for a "<?php echo $type[1]?>" named "<?php echo $_POST['Name']?>"</p>
<?php
}
if ($_POST['Debug'] == "on"){
debugDisplay();
}
break;
// #################
// Add Summary
// #################
case "2":
$type = explode(":",$_POST['type']);
?>
<h1>New <?php echo $type[1]?> : <?php echo $_POST['Name']?></h1>
<?php
switch( $type[0] ){
case "Movie":
?>
<p>Released in <?php echo $_POST['MovieYear']?></p>
<p><?php echo nl2br(stripslashes($_POST['Desc']))?></p>
<?php
break;
default:
?>
<h2>Quick Bio</h2>
<p><?php echo nl2br(stripslashes($_POST['Bio']))?></p>
<?php
break;
}
break;
// ###############
// Starting form
// ###############
default:
require('startform.php');
break;
}
?>
Thanks a lot. This book really teaches you more of debugging than of learning PHP.
|
|

July 26th, 2006, 10:39 AM
|
|
Authorized User
|
|
Join Date: Jul 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello. I think you are missing this code (which should go just before the "switch" code):
if (!isset($_GET['step']))
{
require('startform.php');
}
else
{
|
|

July 26th, 2006, 05:53 PM
|
|
Registered User
|
|
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
I guess i'll try inserting the IF statement. Thanks a lot for the help.
|
|

July 27th, 2006, 02:52 PM
|
|
Authorized User
|
|
Join Date: Jul 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Your welcome. That would do it (let me know if you have other issues - Ijust finished Chptr 5 and got it all working.
|
|

July 27th, 2006, 06:38 PM
|
|
Registered User
|
|
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by tbrown
Your welcome. That would do it (let me know if you have other issues - Ijust finished Chptr 5 and got it all working.
|
Hi Thrown,
It worked!...thanks a lot that was so helpful of you.
|
|
 |