Page 1 of 1

PHP with forms not working

Posted: Mon Jan 19, 2004 2:01 pm
by coindood
I've been trying to get forms and php working forever, using code from everywhere like http://hotwired.lycos.com/webmonkey/01/ ... rogramming
for forms examples, butwhenever I put the files on my computer, the variables never get sent. I'm using Apache 2.0, and I know it's not apache because it happens with 1.3 with me, and PHP 4.3.4.

Nevermind

Posted: Mon Jan 19, 2004 2:06 pm
by coindood
just searched! sorry! shoulda searched furst!
:roll:

Posted: Mon Jan 19, 2004 2:14 pm
by phpcoder
I think u must b accessing ur form data directly by its name such as if u have

Code: Select all

<input type="text" name="me">
then u r accesing it in php as

Code: Select all

echo $me;
try it with

Code: Select all

echo $_POST&#1111;'me'];
coz by default the global variables r off in php.ini file either turn them on

Posted: Mon Jan 19, 2004 2:16 pm
by patrikG
The article is dated. To get it working, change

Code: Select all

<?php
print $YourName;
?>
in file "bad_words.php" to

Code: Select all

<?php
print $_POST["YourName"] 
?>
For further reading regarding forms and variables in PHP I suggest http://www.devnetwork.net/forums/viewtopic.php?t=511 which deals exactly with your problem.

Thanks!

Posted: Mon Jan 19, 2004 5:27 pm
by coindood
Thanks for the posts. I posted the thread about five seconds before I found the answer on the same thread posted above! thanks anyways!