Wrox Programmer Forums
|
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
 
Old September 10th, 2005, 05:28 PM
Registered User
 
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to saeedos
Default i have a question about ....

Hi
first, i am sorry for my weak language ...
i have ( beginning PHP 4 ) book . and i have some question about the code in page 265 - 266.
i know the echo() function it's used to writes a line of text into the screen....
why we use it in every line in this code ...
please explain it to me .. Thannks
the code :
-------------
//menu1.php
<HTML>
<HEAD><TITLE>Welcome to Charlie's</TITLE></HEAD>
<BODY>
<?php
$Entrees=array("Steak ($9)", "Pizza ($7)", "Pasta ($6)");
echo "<FORM METHOD=POST ACTION='menu2.php'>";
echo "Which of the following would you like as an entree?";
echo "<SELECT NAME='ListBox1'>";
echo "<OPTION SELECTED VALUE=''>Select...</OPTION>";
echo "<OPTION>$Entrees[0]</OPTION>";
echo "<OPTION>$Entrees[1]</OPTION>";
echo "<OPTION>$Entrees[2]</OPTION>";
echo "</SELECT><BR><BR>";
echo "<INPUT TYPE=SUBMIT>";
echo "</FORM>";
?>
</BODY>
</HTML>
---------------------------------------------------------------
//menu2.php
<HTML>
<HEAD><TITLE>Welcome to Charlie's dessert selection</TITLE></HEAD>
<BODY>
<?php
$Desserts=array("Apple Pie ($3)","Pancakes ($3)","Ice Cream ($2)");
echo "<FORM METHOD=POST ACTION='bill.php'>";
echo "Which of the following would you like as a dessert?";
echo "<SELECT NAME='ListBox2'>";
echo "<OPTION SELECTED VALUE=''>Select...</OPTION>";
echo "<OPTION>$Desserts[0]</OPTION>";
echo "<OPTION>$Desserts[1]</OPTION>";
echo "<OPTION>$Desserts[2]</OPTION>";
echo "</SELECT><BR><BR>";
echo "<INPUT TYPE=HIDDEN NAME=Course1 VALUE='$ListBox1'>";
echo "<INPUT TYPE=SUBMIT>";
echo "</FORM>";
?>
</BODY>
</HTML>
--------------------------------------------------
//bill.php
<HTML>
<HEAD><TITLE>Thank you for dining at Charlie's</TITLE></HEAD>
<BODY>
<?php
$total = 0;
echo "Your order was for the following:<BR><BR>";
echo "Entree: $Course1<BR>";
echo "Dessert: $ListBox2<BR><BR>";
foreach (array($Course1, $ListBox2) as $val) {
if (ereg("[0-9]+", $val, $regs)) $total += $regs[0];}
echo "TOTAL BILL = $" . $total . "<BR>";
?>
</BODY>
</HTML>

i MISS U Noranti





Similar Threads
Thread Thread Starter Forum Replies Last Post
question maheshraju ASP.NET 2.0 Basics 3 March 13th, 2008 08:54 AM
Question Ashwini Classic ASP Databases 3 January 10th, 2006 07:20 AM
Question? Calibus Classic ASP Databases 8 August 6th, 2004 08:25 AM
a question gorji C++ Programming 2 August 11th, 2003 07:41 AM





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