p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Getting error on Chapter 3 example


Message #1 by lminter@f... on Fri, 11 Oct 2002 20:30:45
Ok, I keep getting an error on what should be a an easy script example. I 
tried the files provided by the website and I get the same error.

Error:
Notice: Undefined variable: Author in c:\inetpub\wwwroot\php\text.php on 
line 6

HTML:
<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>

PHP:
<html>
<head></head>
<body bgcolor="#ffffff">
Your favorite author is:
<?php
echo $Author;
?>
</body>
</html>

Help!
Message #2 by "Lonnie Minter" <lminter@f...> on Fri, 11 Oct 2002 21:06:25
Never mind. I found it. I needed to set register_globals to "On". 

I understand that this increases my vulnerability security-wise. But I'm 
just starting to learn this stuff and the book currently calls for it to 
be on. 


> Ok, I keep getting an error on what should be a an easy script example. 
I 
t> ried the files provided by the website and I get the same error.

> Error:
N> otice: Undefined variable: Author in c:\inetpub\wwwroot\php\text.php on 
l> ine 6

> HTML:
<> html>
<> head></head>
<> body>

> <form method=get action="text.php">
W> ho is your favorite author?
<> input name="Author" type="text">
<> br><br>
<> input type="submit">
<> /form>

> </body>
<> /html>

> PHP:
<> html>
<> head></head>
<> body bgcolor="#ffffff">
Y> our favorite author is:
<> ?php
e> cho $Author;
?> >
<> /body>
<> /html>

> Help!

  Return to Index