Hey guys,
I'm a total newbie with this PHP stuff but i'm stuck with my page that allows people to sign up to my mailing list. Every time you press the "Submit Query" button on the form it brings up the option to download the php file. Have been working on it for a while and can't figure it out, its really starting to bug me!
Anyway, here is the code, if you need any more info let me know:
HTML
<form action="mail.php" method="post">
Email: <input type="text" name="email" />
<input type="submit" />
</form>
PHP
<?php
include 'auth.php';
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
@mysql_select_db(test) or die( "Unable to select database");
$sql="INSERT INTO mail (email)
VALUES
('$_POST[email]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
mysql_close($con)
?>
It's probably something simple i'm overlooking, but all help is appreciated!