日期:2014-05-17  浏览次数:20446 次

php中加入javascript想要没有输入title的时候跳出对话框以后在回到ckeditor里面重新编辑。

我这样可以弹出这个消息提示框
我用了一个if语句。然后想要实现一个功能:按了确定以后在回到首页。可是当我添加了注释掉的这句话以后就是直接跳转到之前的页面了,不会弹出对话框了。怎么办

求解!!!
这是a.php:
<?php
include('conn.php');
$head=$_POST['head'];
$content=$_POST['content'];


?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>
a
</title>
<meta name="keywords" content="关键字列表" />
<meta name="description" content="网页描述" />
<link rel="stylesheet" type="text/css" href="" />
<style type="text/css">
*{
font-size:20px; /*设置当前网页的“基本字体大小为12px*/
}
.content{
color=#0066ff text-align=right border-bottom=dashed 1px grey
}
</style>
</head>
<body>


<?php
if($head!=NULL)
    {
    $sql="insert into ckfinder values('$head','$content')";
mysql_query($sql) or die(mysql_error());
$sql="select *from ckfinder";
    echo "<u>title:</u>&nbsp&nbsp&nbsp&nbsp</u>$head<br/>";
        echo "<u>date:</u>&nbsp&nbsp&nbsp&nbsp".date("Y").".".date('m').".".date('d');
        echo"<br/>";
        echo "<u>content</u>:</br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
         <table border='0' width='400' align='left' cellspacing='0' ><tr><td class='.content' >$content</td></tr><table>";
        echo"</hr>" ;
    } 
    else 
    {
echo"<script type='text/javascript'>alert('请输入标题!')</script>";
    header("Location:ck.php");
}
    ?>
    
</body>
</html>




这是ck.php

[code=php]
<html>
<head>
<meta http-equiv="Content-Type"Content="text/html;charset=utf-8">
<title>
        ckeditor与ckfinder的配置和调用
</title>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>