hot bắt đầu chủ đề từ 7 năm trước

@war ·


mọi người cho mình hỏi đoạn code này sai ở đâu mà nó k add đc dữ liệu nhỉ :(

<```
?php
$host = "localhost";
$user = "root";
$pass = "";
$connect = @mysql_connect($host, $user, $pass, $charset = 'utf8');
mysql_query("SET NAMES " . $charset, $connect);
@mysql_select_db("75shop");
error_reporting(E_ALL & ~ E_NOTICE); 
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form" name="form" method="post">
Email:
<BR>
<input type="text" id="email" name="email" style="width: 390px;" value="">
<input type="submit" name="SUBMIT" value="Submit">
<BR>
<?php
$ds = explode(",",$email);
foreach($ds as $i=>$email)
{
$sql = "INSERT INTO oc_newsletter (`news_email`) VALUES('".$email."')";
$r = mysql_query($sql )or die(mysql_error());
echo " insert into `oc_newsletter` (`news_email`) VALUES('".$email."')<br/>";
}
?>
</form>
</body>

Viết câu trả lời

Drop Images

1 Bình luận

hubrie avatar

bỏ cái error_reporting(E_ALL & ~ E_NOTICE); thì báo như này bạn ak Notice: Undefined variable: email in C:\xampp\htdocs\shop\insert.php on line 24