就是不知道为什么插入不进去求指点最好是给改改谢谢新手见笑了<?phpinclude ("lianjie.php");if(is_uploaded_file($_FILES['upfile']['tmp_name'])){$upfile=$_FILES["upfile"];$name=...
就是不知道为什么插入不进去 求指点 最好是给改改 谢谢 新手见笑了
$upfile=$_FILES["upfile"];
$name = $upfile["name"];$type = $upfile["type"];$size = $upfile["size"];$tmp_name = $upfile["tmp_name"];$error = $upfile["error"];
switch ($type) { case 'image/pjpeg' : $ok=1; break; case 'image/jpeg' : $ok=1; break; case 'image/gif' : $ok=1; break; case 'image/png' : $ok=1; break;}
if($ok && $error=='0'){ move_uploaded_file($tmp_name,'H:\文件/'.$name); echo "上传成功";}}$name=$_POST['name'];echo $name;if($_POST['submit'])$sql = "INSERT INTO school 1(id,title,tupian)values('','$_POST[name]','$_POST[tmp_name]')";$query = mysql_query($sql);echo $sql;exit();?>
上传文件:
展开