user4fun Posted February 13, 2006 Share Posted February 13, 2006 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 More sharing options...
gsmith Posted February 14, 2006 Share Posted February 14, 2006 what is in your AddEmail.php file already? Code of anything you already have will be helpful so we can just help you with what's missing. Link to comment Share on other sites More sharing options...
user4fun Posted February 15, 2006 Author Share Posted February 15, 2006 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 More sharing options...
gsmith Posted February 15, 2006 Share Posted February 15, 2006 <?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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now