Form-problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
suesicus
Forum Newbie
Posts: 7
Joined: Mon May 05, 2003 6:43 am

Form-problems

Post by suesicus »

Why isn't this working?! Is there a problem in my PHP-configuration?!

The name of this document is testar.php

<html>
<head>
<title>Testing</title>
</head>
<body>

<?
echo $var;
?>

<form action="testar.php" method="post">
<input type="text" name="var">
<input type="submit" value="Shoot">
</form>

</body>
</html>

It's like it doesn't send the variable "$var" to the page. I've tried to send it to another page but it doesn't work there either!
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

If you view the source in the browser,
do you see <? echo $var ?> or nothing?

If you see <? echo $var ?> then your webserver doesn't know that you want to use php. Not a php-configuration problem, but a apache(or other webserver software) configuration problem.
suesicus
Forum Newbie
Posts: 7
Joined: Mon May 05, 2003 6:43 am

Post by suesicus »

I see nothing..

if I write..

$var = "Hello";
echo $var;

.. I see Hello.. So somehow it doesn't send the variable from the form..
suesicus
Forum Newbie
Posts: 7
Joined: Mon May 05, 2003 6:43 am

Post by suesicus »

It must be something wrong with my computer becouse it works on my server..

Maybe I have to reinstall PHP and all that stuff..
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Please read:
viewtopic.php?t=511

Mac
suesicus
Forum Newbie
Posts: 7
Joined: Mon May 05, 2003 6:43 am

Post by suesicus »

ahh...

THANKS!
Post Reply