jester420247 Posted January 13, 2007 Share Posted January 13, 2007 All I am trying to do is take the input from the 2 text boxes and write them to my database. Then I would like a page to view all the data in the table. I am trying to store a mailing list for my website. Any help will be greatly appreciated.[code]<?php $self = $_SERVER [ ' PHP_SELF ' ] ;$email = $_POST [ ' email ' ] ;$name = $_POST [ ' name ' ] ; ?><form action="<?php echo( $self ) ; ?>" method="post">email: <input type="text" name="email" size="8">name: <input type="text" name="name" size="8"><input type="submit" value="Submit"> </form><?phpif( $email and $name ){$conn = @mysql_connect( "mysql187.secureserver.net", "user", "password" ) or die ( "Err : Connv" ) ;$rs = @mysql_select_db( "emailaddresses", $conn ) or die ( "Err: DB" ) ;$sql= "INSERT INTO into emailaddresses (email, name) values ('$email', '$name')";mysql_query($query); $rs + mysqlquery( $sql, $conn );}if($rs){echo ("Record added:$name,$email" ); }?> [/code] Link to comment https://forums.phpfreaks.com/topic/33987-i-need-help-with-a-very-simple-form-please/ Share on other sites More sharing options...
trq Posted January 13, 2007 Share Posted January 13, 2007 Whats your question / problem? Link to comment https://forums.phpfreaks.com/topic/33987-i-need-help-with-a-very-simple-form-please/#findComment-159723 Share on other sites More sharing options...
jester420247 Posted January 13, 2007 Author Share Posted January 13, 2007 This code does not seem to write to my database and I would like it if someone could help trouble shoot it with me, I have spent far too long today on this little task. Link to comment https://forums.phpfreaks.com/topic/33987-i-need-help-with-a-very-simple-form-please/#findComment-159726 Share on other sites More sharing options...
jester420247 Posted January 13, 2007 Author Share Posted January 13, 2007 Also, I do not know if this would make any differance but this is the querry I ran to make my table:[code]CREATE TABLE `emailaddresses` (`email` VARCHAR( 255 ) NOT NULL ,`name` VARCHAR( 255 ) NOT NULL) ENGINE = MYISAM ;[/code] Link to comment https://forums.phpfreaks.com/topic/33987-i-need-help-with-a-very-simple-form-please/#findComment-159730 Share on other sites More sharing options...
trq Posted January 13, 2007 Share Posted January 13, 2007 Sorry, I htink you need to read some more [url=http://hudzilla.org/phpwiki/index.php?title=Databases]tutorials[/url], this code is a complete mess and just fixing it wont really help you understand whats not working. Link to comment https://forums.phpfreaks.com/topic/33987-i-need-help-with-a-very-simple-form-please/#findComment-159745 Share on other sites More sharing options...
jester420247 Posted January 13, 2007 Author Share Posted January 13, 2007 Thats a real stinker since I copied it to the letter from a PHP book I just got :-[ I dont have the time to learn PHP today which is why I came here for some help, I guess I will have to hire a coder for this simple task :-\ Link to comment https://forums.phpfreaks.com/topic/33987-i-need-help-with-a-very-simple-form-please/#findComment-159747 Share on other sites More sharing options...
trq Posted January 13, 2007 Share Posted January 13, 2007 [quote]Thats a real stinker since I copied it to the letter from a PHP book I just got[/quote]What book would that be? And yeah... Id'e definately throw it. Hope it wasn't written by someone around here. Link to comment https://forums.phpfreaks.com/topic/33987-i-need-help-with-a-very-simple-form-please/#findComment-159751 Share on other sites More sharing options...
jester420247 Posted January 13, 2007 Author Share Posted January 13, 2007 PHP 5 in easy steps by Mike McGrath, can you reccomend anyone that could code this really cheap for me? Link to comment https://forums.phpfreaks.com/topic/33987-i-need-help-with-a-very-simple-form-please/#findComment-159759 Share on other sites More sharing options...
trq Posted January 13, 2007 Share Posted January 13, 2007 Post a message in the 'freelance' forum. Im locking this topic. Link to comment https://forums.phpfreaks.com/topic/33987-i-need-help-with-a-very-simple-form-please/#findComment-159765 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.