Home > Article > Backend Development > PHP的效能已经实现,却总是报错
PHP的功能已经实现,却总是报错
代码的目的是实现图片上传到指定目录,并且在mysql中记录图片路径。
现在目的已经实现,可是页面总是报错,
报错内容就是第二行:
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> <?php if ($_GET['action'] == "save"){ //这行报错:Notice: Undefined index: action in D:\xampp\htdocs\upload.php on line 2 include_once('MYDBconn.php'); include_once('UPclass.php'); $titles=$_POST['title']; $images=$uploadfile; if($titles == "") echo"<Script>window.alert('No title');history.back()"; $sql="insert into product(title,pic) values('$titles','$images')"; $result=mysql_query($sql,$conn); echo"<script>window.alert('congratunations');location.href='upload.php'</script>"; } ?> <title>images transfer</title>