0

javascript 代码中的 php 以 php statememnt 而不是 $_GET 值的形式返回,配置中是否有需要更改的内容?这在大学 apache 服务器上工作,但在这种情况下似乎不是,PHP 和 javascript 在其他页面上工作得很好。删除也很好。

<SCRIPT LANGUAGE="JavaScript">
  setTimeout(function(){
  alert("<?echo $_GET['deletename']?> Deleted, you will now return to the Artist Search...")
    window.location = "http://www.aaaaa.tk/CI/index.php/about?deletedartist=<?echo $_GET['deletename']?>";
  }, 100);

 </script>
 <link rel="stylesheet" type="text/css" href="main.css">
 </head>
 <?php

 $artistid = $_GET['deleteid'];

$username="X";
$password="X";
$database="X";
mysql_connect(localhost,$username,$password) or die("Could not connect : " . mysql_error()); 
@mysql_select_db($database) or die( "Unable to select database");
/* Performing SQL query */ 
$query = "DELETE FROM fbartist WHERE id =$artistid"; 
$query2 = "ALTER TABLE fbartist AUTO_INCREMENT=1;"; 
$result = mysql_query($query) or die("Delete Query failed :".$query."" . mysql_error()); 
$result2 = mysql_query($query2) or die("Auto Increment Query failed : " . mysql_error()); 

mysql_close(); 
?>

感谢您提供的任何帮助。

4

1 回答 1

2

要么尝试

alert("<?php echo ....

或者

检查php.inishort_open_tag = on这里

于 2013-06-30T14:47:28.463 回答