Jump to content

Crazy with insert


user4fun

Recommended Posts

for the love of god please helpI am going crazy trying to find information and they are all too complex for me.All i want is a form with a text box called email and a submit button //already created called NewsLetterList.htmwhen the submit button takes place the AddEmail.php is ranwhen the php file is ran it adds the email address from the form in a table called newsletter under a database called customer. //both have already ben created. ther is no username password, this and that? just a form, a button, and a table.\PLEASE IF YOU CAN DO THIS AND I AM SURE YOU CAN, HELP ME, i truly am going crazy?????

Link to comment
Share on other sites

Thank you for trying to help, i had to leave it alone for a day so i can come back with a fresh brain.her is what i ahve in my php file ( sadly enough it seems to be all wrong)***************************8<html><head> <title>Email PHP add</title></head><body bgcolor="white"><?phpforeach($HTTP_POST_VARS as $varname => $value) $formVars[$varname]=$value;INSERT into NewsLetter(Email) VALUES($Email)mysql_select_db("Customer");echo "Record Added<br><a href=\"NewsLetterList.htm\">click here</a>to return to Business Information Control<br>";$query="INSERT INTO NewsLetter"."Email= \"".$formVars["Email"]."\","."Status= \"".$formVars["Status"]."\",".mysql_query($query);mysql_close($db1);?></body></html>****************************I got all that from different tutorials and sample codes, offcourse nothing is working is i am wrong.

Link to comment
Share on other sites

<?phpforeach($HTTP_POST_VARS as $varname => $value)        $formVars[$varname]=$value;
I'm currently not too familiar for dealing with MySQL databases, so I might not be able to help you much with that portion. But the above part of your code confuses me.If you're getting a variable from a Form text box (the e-mail) you should set a variable and then write to the database using the variable. Set the variable like this:
$email = $_POST['textboxname'];

(this is assuming your Form uses the Post method)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...