russellkain
01-30-2006, 09:40 AM
Apparently my sh**ty web provider doesn't allow POST commands. How would I change my files to use the GET command instead? Input file lets user input email address, posts to php file (submit.php) and then writes to subscribers.txt.
input.htm
<html>
<head>
<title>Subcribe</title>
</head>
<body>
<form name="subscribe" action="submit.php" method="POST">
Enter your email address : <input type="text" name="emailadd" /><br
/>
<input type="submit" name="submit" value="Subscribe" />
</form>
</body>
</html>
submit.php
<?php
$emailAddress = $_POST['emailadd'];
if(!$emailAddress)
{
echo "Please enter your email address.";
exit;
}
else
{
$filename = "subscribers.txt";
$content = "$emailAddress\n";
$fp = fopen($filename, "a");
$fw = fwrite( $fp, $content );
fclose( $fp );
if(!$fw) echo "Couldn't write the entry.";
else echo "Successfully wrote to the file.";
}
?>
any ideas?
regards,
Russell
input.htm
<html>
<head>
<title>Subcribe</title>
</head>
<body>
<form name="subscribe" action="submit.php" method="POST">
Enter your email address : <input type="text" name="emailadd" /><br
/>
<input type="submit" name="submit" value="Subscribe" />
</form>
</body>
</html>
submit.php
<?php
$emailAddress = $_POST['emailadd'];
if(!$emailAddress)
{
echo "Please enter your email address.";
exit;
}
else
{
$filename = "subscribers.txt";
$content = "$emailAddress\n";
$fp = fopen($filename, "a");
$fw = fwrite( $fp, $content );
fclose( $fp );
if(!$fw) echo "Couldn't write the entry.";
else echo "Successfully wrote to the file.";
}
?>
any ideas?
regards,
Russell