猿问

帮忙检查一下代码格式问题

if (move_uploaded_file($fileInfo['tmp_name'],$destination)) {

$kejian=mysql_connect("loalhost","root","root");
mysql_select_db("kejiandizhi",$kejian);
mysql_query("INSERT INTO dizhi (id) VALUES ('{$fileInfo['name']}'));
mysql_close($kejian);

  echo "<script language=\"JavaScript\">\r\n";
  echo " alert(\"文件上传成功\");\r\n";
  echo " history.back();\r\n";
  echo "</script>";
  exit;

}

 

在上段代码中显示echo "<script language=\"JavaScript\">\r\n";这一行syntax error, unexpected T_STRING

 

慕仔8661472
浏览 1344回答 2
2回答

慕莱坞9220042

你好,试试这个:echo '<script language=\"JavaScript\">\r\n';
随时随地看视频慕课网APP
我要回答