Тема: Не записуються дані у БД.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</head>
<body>
<div id="container">
<div id="header">
<div id="logo-clock"> <img src="img/logo-clock.png" width="230" height="78" alt="Годинник"> </div>
<div id="logo"> LOGO </div>
</div>
<div id="content">
<div id="shou">
<div id="shou1">
<p id="hello">Hello guys!</p>
<p id="privet">Thank you for choosing us! </p>
<p id="privet">Fill out the form below to subscribe for our newsletters:</p>
</div>
<div id="shou2">
<p id="hello">Thank you for subscribing!</p>
<p id="privet">You have been subscribed successfully.</p>
</div>
</div>
<div id="form1">
<!-- header("Location: http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
exit;-->
<form id="form" action="javascript:void(0);" method="post">
<p>
<input type="text" name="name" value="Your name" id="name" class="name2">
</p>
<p>
<input type="text" name="email" value="Your Email" id="name" class="name1" >
</p>
<p>
<input type="checkbox" name="ch" id="ch">
<span id="che">Receive news and special offers from Coppertino Inc.</span>
</p>
<p>
<input type="submit" name="submit" value="SUBSCRIBE" id="but" onClick="btnClick();">
</p>
</form>
<?php
$db = mysql_connect ("localhost","root","");
mysql_select_db("maillist",$db);
mysql_query("SET CHARACTER SET utf8");
if(isset($_POST['submit']))
{
$result = mysql_query("INSERT INTO users (name,email) values ('$_POST[name]','$_POST[email]')");
if ($result == 'true')
{
$subject = "Підписка";
$name = $_POST['name'];
$email = $_POST['email'];
$message = "Имя: {$name}, email: {$email}, повідомлення: Ви підписались на розсилку";
if(mail("rusikz94@gmail.com", $subject, $message));
}
}
?>
<script>
function btnClick()
{
$('#shou1').hide(1000);//hide("fast");
$('#form1').hide(1000);//hide("fast");
$('#shou2').fadeIn(2000);//show("slow");
};
</script>
</div>
</div>
<p id="hhh1"></p>
<div id="footer">
<div id="soz">
<p id="tw"><a href="http://twitter.com" title="Twitter" target="_blank" > <img src="img/tw.png"></a></p>
<p id="tw1"><img src="img/tbg.png"></p>
<p id="go"><a href="http://plus.google.com" title="Google+" target="_blank"><img src="img/go.png"></a></p>
<p id="go1"><img src="img/tbg.png"></p>
<p id="in"><a href="http://in.com" title="In" target="_blank"><img src="img/in.png"></a></p>
<p id="in1"><img src="img/tbg.png"></p>
<p id="f"><a href="http://www.facebook.com" title="Facebook" target="_blank"><img src="img/f.png"></a></p>
<p id="с">2013 © Testy, inc.</p>
</div>
</div>
</div>
</body>
</html>
цей код працює міняє написи але не заносить в базу даних