我正在使用alertify.js库向用户提示cormfirmation。如果用户按下确定,它将运行某些PHP功能。警报是使用php回显的。但它会返回错误。
<?php
include('header.php');
if( isset($_GET['id']) && $_GET['action'] == 'delete'){
$id = $_GET['id'];
echo '<script type="text/javascript">
alertify.confirm("Confirm Title", "Confirm Message", function(){ alertify.success("Ok")'.
if($user->deleteAccount($id)){
$_SESSION['current_url'] = $_SERVER['PHP_SELF'];
/* echo "<script type='text/javascript'>
window.location.replace('clear_Post.php');
</script>";*/
}
.' }
, function(){ alertify.error("Cancel")});
</script>';
}
&GT;