Posted by ChevyDriver on 07/09/05 06:29
Here is the exaple from the book that I'm using.
The first page is a simple html page with a form and the coding they use is
this:
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form method="get" action="text.php">
Who is your favourite author?
<input name="Author" type="text">
<br>
<br>
<input type="Submit">
</form>
</body>
</html>
The php code they use for the php file is this:
<html>
<head>
<title>Untitled</title>
</head>
<body>
Your favourite author is:
<?php
echo $Author;
?>
</body>
</html>
Thanks for the help.
"Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message
news:8fjpc19t7s1nnqe9kiqqn94vk7fq4ru1oj@4ax.com...
> I noticed that Message-ID: <Rq3ze.625$Jt.585@read1.cgocable.net> from
> ChevyDriver contained the following:
>
> >Now working with some of the examples from the book and I'm
> >getting an undefined error when I process the script which gets a simple
> >text input from a form.
>
> Variables obtained from a form are only defined when the form is
> submitted.
>
> This will give a notice before the form is submitted:
>
> print $_POST['textbox_name'];
>
> To avoid the notice do:
>
> if(isset($_POST['textbox_name'])){
> print $_POST['textbox_name'];
> }
>
> >If you need any further information, I will provide it.
>
> Ummm, a look at the code would be helpful...
>
>
>
> --
> Geoff Berrow 0110001001101100010000000110
> 001101101011011001000110111101100111001011
> 100110001101101111001011100111010101101011
[Back to original message]
|