View Full Version : cannot submit forms to mysql

12-07-2003, 06:14 AM
hi there. i am having some trouble with this script, and was wondering if someone could help me out.

the script:

if ($test) { printf( "test worked");};

<form method="post" action="<?php echo $PHP_SELF ?>">
<input type="submit" name="test" value="submit">

That is the simplest i could come up with. When you click on the submit button, it should show "test workd" above it.

this will not work. I have taken it to another server with php/mysql, and it worked there (i did change the db and table names).

i have another script to commuicate with mysql, but i will worry about that later, since i cant even get this one to work.

does anyone have any suggestions?

thanks alot,


Dylan Leblanc
12-07-2003, 09:41 AM
Try $_POST['test'] rather than $test

12-07-2003, 11:43 AM
Also, it's $_SERVER['PHP_SELF'] and not $PHP_SELF. You'll need to get used to working with the super globals to ensure your scripts will work on any server and are more secure