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:


<form action="mail.php" method="post">
Email: <input type="text" name="email" /> 
<input type="submit" />


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)

if (!mysql_query($sql,$con))
  die('Error: ' . mysql_error());
echo "1 record added";


It's probably something simple i'm overlooking, but all help is appreciated!

First off, you need to validate the user form contents. I have experienced the file forcing a download on xampp and mamp. My solution came to me when I checked the error log files. This might be a great place to start looking.