beginners question; error variables 
Author Message
 beginners question; error variables

Hello there,

I tried to read a variable from one form in another using the following
code:

filename: "index.htm":
<html>
<form action="test.php" method="get">
Enter your text:
<input type="text" name="tekst" value="blabla">
<input type="submit" value="Verstuur" name="submit">
</form>
</html>

filename: "test.php":
<?php
  echo "$tekst";
?>

But all I get when I run "index.htm" is this error:
Notice: Undefined variable: tekst in c:\inetpub\wwwroot\CS2\verwerk.php on
line 2
althoug the url line does contain the variable:
http://localhost/test.php?tekst=blabla&submit=Verstuur

I thought it should work, what am I doing wrong?

Thanks, Chris



Sun, 31 Jul 2005 05:08:14 GMT  
 beginners question; error variables
Hi,
if you have PHP 4.2 an higher:
try: echo $_GET["tekst"];

Tip:
http://www.dclp-faq.de/q/q-formular-methode.html



Quote:
> Hello there,

> I tried to read a variable from one form in another using the following
> code:

> filename: "index.htm":
> <html>
> <form action="test.php" method="get">
> Enter your text:
> <input type="text" name="tekst" value="blabla">
> <input type="submit" value="Verstuur" name="submit">
> </form>
> </html>

> filename: "test.php":
> <?php
>   echo "$tekst";
> ?>

> But all I get when I run "index.htm" is this error:
> Notice: Undefined variable: tekst in c:\inetpub\wwwroot\CS2\verwerk.php on
> line 2
> althoug the url line does contain the variable:
> http://localhost/test.php?tekst=blabla&submit=Verstuur

> I thought it should work, what am I doing wrong?

> Thanks, Chris



Sun, 31 Jul 2005 05:25:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Beginner J questions: local variables

2. Beginners Question - use of variables

3. Beginners' Question -- Assigning variables in a lambda

4. More beginner's questions: singleton variables

5. VARIABLE MANAGEMENT: BEGINNER QUESTION

6. beginner question - is a tag a variable?

7. Beginners Question: Error check on read?

8. button question (not a beginner question?)

9. Beginner: Character from a string, variable types

10. $_GET variable variables, dynamic parsing (I'm not sure how to summarize this question)

11. Newbie question: Logical variable in CLP/Prolog vs variable in C

12. TCL Newbie Question: using variables to reference variables

 

 
Powered by phpBB® Forum Software