p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Problems with Begin PHP4, Chap. 3 examples


Message #1 by "Phillip Duba" <nogoals4u@y...> on Wed, 24 Jan 2001 03:09:51 -0000
I am having a few problems with the form problems in Chapter 3 of the

Beginning PHP4 book. I am running PWS on a Win98 machine. I was able to do

all examples in Chapter 2 and get phpinfo.php to run. Here's my code for

text.html and text.php, respectively:



<html>

<head></head>

<body>

<form method="get" action="text.php">

Who is your favorite author?

<input name="author" type="Text">

<br>

<br>

<input type="Submit">

</form>

</body>

</html>



<html>

<head></head>

<body>

Your favorite author is:

<?php

echo $author;

?>

</body>

</html>



I have confirmed that the URL is passing the paramter. Thanks,



Phil

Message #2 by "Phillip Duba" <nogoals4u@y...> on Wed, 24 Jan 2001 14:06:42 -0000
I sent this to Richard, who was kind enough to look at my earlier post,

but I wanted to send to the entire list in case anyone else has any

insight as well. Thanks,



Phil



Well, I tried the multiple checkboxes example and when I checked the

source of the blank page, here is what I saw:



<html>

<head></head>

<body>

<br><br><br></body>

</html>



This was generated by the following code:



<html>

<head></head>



<body>

<?php

echo "$Choice1<br>";

echo "$Choice2<br>";

echo "$Choice3<br>";

?>

</body>

</html>



So it seems to be going into PHP and executing, it just doesn't seem to

understand the variables or that they should be coming from the forms. I

only have this problem with variables coming from the form. No setting

within one of the PHP files needs to be changed, does it? Thanks,



Phil




  Return to Index