PDA

View Full Version : مشکل این کد در کجاست؟



jamejam123
جمعه 14 تیر 1392, 14:03 عصر
سلام
هرکاری می کنم این کد کار نمی کند.
<?php require_once("include/function.php"); ?>
<?php require_once("include/connection.php"); ?>
<?php
if(isset($_POST['submit'])){
$name=$_POST['name'];
$price=$_POST['price'];
$tozih=$_POST['tozih'];
$images=$_POST['images'];
$query="insert into produce(id,name,price,tozih,images)values(null,$na me,$price,$tozih,$images)";
$res=mysql_query($query,$connection);
if($res){
echo "oookk";
}else{
$matn="noo";}
}


?>
<!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>insert</title>
</head>
<?php if(isset($matn)){
$matn;
} ?>
<body>
<form method="post" action="pp.php">
<input type="text" name="name" />
<input name="price" type="text" />
<textarea name="tozih"></textarea>
<input type="file" name="images" />
<input type="submit" name="submit" value="ersal" />
</form>
</body>
</html>
می خواهم در این جدول اطلاعات را دخیره کنم
106631
http://barnamenevis.org/images/misc/pencil.png

navid3d_69
جمعه 14 تیر 1392, 15:42 عصر
این رو تست کنید




$query="insert into produce(name,price,tozih,images)values('$name','$p rice','$tozih','$images')";