I cant find this anywhere. All I need is a form to collect email address and name and store it in a txt file or mysql. Does anyone know where I can get this?
http://www.plus2net.com/php_tutorial/php_signup.php Its a pretty easy thing to do and a lot of the scripts will be way more than you need. Post back if you want me to do an example.
Ya that looks like more than I need. Just need name and email and store it somewhere. Can you show me an example of that?
<?php include('dbconnect.inc.php'); $author = $_POST["author"]; $email = $_POST["email"]; $author=mysql_escape_string($author); $email=mysql_escape_string($email); if($email==""){ ?> <form> Email<input type="text" name="email"> Name<input type="text" name="author"> </form> <?php } else { $SQLcommand = "INSERT INTO yourtable"; $SQLcommand = "$SQLcommand (name,email) "; $SQLcommand = "$SQLcommand VALUES("; $SQLcommand = "$SQLcommand '$author','$email') "; MYSQL_QUERY($SQLcommand); echo"Thanks"; } ?> PHP:
Im have very little experience at this. Would the only thing I need to change to make this work is to make a dbconnect.inc.php file? Those SQLcommand lines look fishy to me.
The sqlcommands are copied from one of my email collection scripts. This is the dbconnect file: $mainconnection =MYSQL_CONNECT("localhost","user","pass") OR DIE("Unable to connect to database"); @mysql_select_db("yourdbname") or die("Unable to select database"); PHP: