This is too simple not to work
Posted: Sun Feb 07, 2010 11:43 am
I have a flash form that sends 2 pieces of information Email address and Nationality. This is sent to Email.php, where the following code is used:-
This succesfully enters the NULL value into the database, however the $mail and $identite variable appear as blank in the database, I'm not sure what this means or exactly where the problem lies.
Here is my database structure:
Table structure for table newletter
Field
Type
Null
Default
Comments
MIME type
Id_client
int(11)
No
E-mail
varchar(40)
Yes
NULL
Identite
varchar(10)
Yes
NULL
Thanks in advance, it's been a while since I did any programming so I probably missed something obvious.
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
<?php
include 'loginphone.php';
include 'clean function.php';
//connect
$connection= mysql_connect($host,$user,$pass);
if (!$connection){
die ("Could not connect : ". mysql_error());
}
//select
$db_select=mysql_select_db($data);
if (!$db_select){
die ("could not select database". mysql_error());
}
//clean
$identite= $_POST["identite"];
$mail= $_POST["mail"]);
//insert
$query = "INSERT INTO newletter VALUES (NULL,'".$mail."','".$identite."')";
$result = mysql_query($query) or die(mysql_error());
?>
</html>Here is my database structure:
Table structure for table newletter
Field
Type
Null
Default
Comments
MIME type
Id_client
int(11)
No
varchar(40)
Yes
NULL
Identite
varchar(10)
Yes
NULL
Thanks in advance, it's been a while since I did any programming so I probably missed something obvious.