1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
if(isset($_POST['submit']))
{

	$con = mysql_connect("localhost","delives0_ideas","ideas");
		
	if (!$con){
		die('Could not connect: ' . mysql_error());
	}

	mysql_select_db("delives0_ideas", $con);
	
	$sqlCmd = sprintf("INSERT INTO data (firstName, lastName, email, idea) VALUES ('%s','%s','%s','%s')", 
		mysql_real_escape_string($_POST["firstName"]),
		mysql_real_escape_string($_POST["lastName"]),
		mysql_real_escape_string($_POST["email"]),
		mysql_real_escape_string($_POST["idea"]));

	//echo $sqlCmd;
	//die();	
	
	mysql_query($sqlCmd);

	mysql_close($con);
}

?>

<form method="post">
	<strong>First name:</strong> <input type="text" name="firstName"/><br/>
	<strong>Last name:</strong> <input type="text" name="lastName"/><br/>
	<strong>Email:</strong> <input type="text" name="email"/>  #####Put a javascript checker for valid emails, like [email protected] format<br/><br/>
	<strong>Idea:</strong><br/>
	<textarea rows="10" cols="30" name="idea"> 
		Hit us with your best shot.
	</textarea><br/>
	<input name="submit" type="submit" value="Submit"/>
</form>