Forum Moderators: coopster
Am new to the site and have a problem I wanted to ask your advise about.
I have ordered a new VPS server with Hostway UK, and my problem is that I can't use the POST method for even the most simple forms.
I have even tried the $_POST variable but nothin seems to get sent to the variables?
Any advice?
The code for simple form I tried is:
<html>
<form action="index.php" method="post">
<input type="text" name="myvar" value="">
<input type="submit" name="submit" value="submit">
</form>
<?php
echo $myvar;
?>
</html>
I have switched globals on in php.ini, but still doesnt work.
Any ideas?
Thanks in advance
<html>
<body>
<?php
if (empty($_POST['submit']))
{
echo '<form name="form1" method="POST" action="'.$_SERVER[PHP_SELF].'">
<input type="submit" name="submit" value="CLICK ME">
<input type="hidden" name="hiddenvar" value="this should show
in post print">
</form>';
}
else
{
echo 'POST WORKED - PRINT POST VARS BELOW<Br>';
echo '<pre>';
print_r($_POST);
echo '</pre>';
}
?>
</body>
</html>
should spit out:
POST WORKED - PRINT POST VARS BELOW
Array
(
[submit] => CLICK ME
[hiddenvar] => this should show in post print
)
hughie
[webmasterworld.com...]
Hughie
Thanks again for all your help
DaSingh