p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Professional PHP 5 ISBN: 978-0-7645-7282-1 (http://p2p.wrox.com/book-professional-php-5-isbn-978-0-7645-7282-1-152/)
-   -   Begin.Php5,,Chap04, page no.158,,ex. dynamic.php (http://p2p.wrox.com/book-professional-php-5-isbn-978-0-7645-7282-1/74234-begin-php5-chap04-page-no-158-ex-dynamic-php.html)

sandeepgreaternoida May 4th, 2009 01:40 AM

Begin.Php5,,Chap04, page no.158,,ex. dynamic.php
 
Begin.Php5,,Chap04, page no.158,,ex. dynamic.php >> this example is not working fine....sombody if already has gone through it pls. let me know...below..i am pasting the original downloaded codes.pls. let me know the errors.
[

<html>
<head><title></title></head>
<body>
<?php
if (isset($_POST['posted'])) {
echo "<form method='POST' action='dynamic.php'>";
for ($counter = 0; $counter < $_POST['number']; $counter ++)
{
$offset = $counter + 1;
echo "<br>Please enter the name of child number $offset<br>";
echo "<input name='child[]' type='text'>";
}
echo"<br>Press the button to move on<br>";
echo "<input type='submit' value='Next'>";
echo "<input type='hidden' name='posted01' value='true'></form>";


} else {

if (isset($_POST['posted01'])) {
$count=0;
echo "Your children's names are:";
do
{
$childs_name = $_POST['child'][$count];
echo"<br><b>$childs_name</b>";
$checkempty = $childs_name;
$count = $count + 1;
} while ($checkempty != "");
if ($count == 1) {
echo "Not applicable";
}
}


?>
<hr>
<form method="POST" action="dynamic.php">
<input type="hidden" name="posted" value="true">
How many children do you have?
<input name="number" type="text">
<br>
<br>
<input type="submit" value="Send Number">
<br>
</form>
<?
}
?>
</body>
</html>

/][:confused:]

JMcCluskey13492@rpc.net November 5th, 2013 11:13 AM

I have the same issue. Has anyone found what the error is in the script?


All times are GMT -4. The time now is 03:54 AM.

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