Email Submit/Mysql Question

Status
Not open for further replies.

Tensegrity

New member
Dec 14, 2007
495
4
0
Brooklyn
leadsmasher.com
I'm designing LPs and I got my first real client last week. In the design I made a "Name" field, and an "Email" field. My client wanted the info from those 2 fields to be sent to a database that he would have access to, and then could use that database to send out mass mailings to. Is this a mysql type of situation? Would I need some PHP script to do this? Or is this something the client should handle on his side with his Control Panel? I eventually want to get to the point where I can do all of this so I can tier my prices according to what needs to be done. Thanx for the help in advance. :)
 


you took the job and don't know what to do???

Create the LP with the details he wants, checkout pear for php, it will be more secure and safe because you obviously don't know what your doing to send the details to the database and I would create a separate part of the site specifically for your client with a login and from here he can view all of the signups and I would include the functionality to save the details in a csv file.
 
PHP:
<?php
	if(isset($_POST['email'])&&isset($_POST['name'])) {
		$email = preg_replace('/[^a-z0-9@\-_\.]/i','',$_POST['email']);
		$name = preg_replace('/[^a-z ]/i','',$_POST['name']);
		mysql_connect('localhost','dbuser','dbpw');
		mysql_query("INSERT INTO database.emails (name,email) VALUES ('$name','$email')");
		mysql_close();
		echo 'entered into database';
	}else {
		echo '<form method="post">Name: <input name="name" /><br />Email: <input name="email" /><br /><input type="submit"></form>';
	}
?>

thats the basics of what you want. you'll need to create a database, a table, and get the right db user info. there is no error handling in that script, but its somewhat secure. just go through it and google anything that you don't understand.
 
Is this a mysql type of situation? Would I need some PHP script to do this?


If you only agreed on doing a design then i think the client should handle this, especially if you have no experience in programming (based on what i quoted above i assume that you have no or not much experience with php coding).

Or you could still tackle it and go search for some easy php+mysql tutorials. It's a perfect test if you are starting out with php+mysql programming.
 
you took the job and don't know what to do???

Create the LP with the details he wants, checkout pear for php, it will be more secure and safe because you obviously don't know what your doing to send the details to the database and I would create a separate part of the site specifically for your client with a login and from here he can view all of the signups and I would include the functionality to save the details in a csv file.

You might have misunderstood me. I DESIGN landing pages...I know nothing of PHP scripting. I figured he had some programmer up his sleeve for the scripting part. I took the job for the graphic design aspect, and he later asked me if I knew how to set up the whole mysql thing. Thanx for the tips and thanx a lot Kyle for that script...I will def put it to use! Muchos Gracias for your help guys! :bowdown:
 
Status
Not open for further replies.