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

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

WBOY
WBOYOriginal
2016-06-13 12:40:191173browse

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

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

求解!!!
这是a.php:

<?php<br />
include('conn.php');<br />
$head=$_POST['head'];<br />
$content=$_POST['content'];<br />
<br />
<br />
?><br />
<html><br />
<head><br />
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/><br />
<title><br />
a<br />
</title><br />
	<meta name="keywords" content="关键字列表" /><br />
	<meta name="description" content="网页描述" /><br />
	<link rel="stylesheet" type="text/css" href="" /><br />
	<style type="text/css"><br />
	*{<br />
			font-size:20px;	/*设置当前网页的“基本字体大小为12px*/<br />
		}<br />
	.content{<br />
		color=#0066ff text-align=right border-bottom=dashed 1px grey<br />
	}<br />
</style><br />
</head><br />
<body><br />
	<br />
<br />
	<?php<br />
	if($head!=NULL)<br />
   	{<br />
   		$sql="insert into ckfinder values('$head','$content')";<br />
		mysql_query($sql) or die(mysql_error());<br />
		$sql="select *from ckfinder";<br />
   		echo "<u>title:</u>&nbsp&nbsp&nbsp&nbsp</u>$head<br/>";<br />
   	    echo "<u>date:</u>&nbsp&nbsp&nbsp&nbsp".date("Y").".".date('m').".".date('d');<br />
   	    echo"<br/>";<br />
        echo "<u>content</u>:</br>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<br />
        	<table border='0' width='400' align='left' cellspacing='0' ><tr><td class='.content' >$content</td></tr><table>";<br />
        echo"</hr>" ;<br />
    } <br />
    else <br />
    {<br />
		echo"<script type='text/javascript'>alert('请输入标题!')</script>";<br />
	    header("Location:ck.php");<br />
	}<br />
    ?><br />
    <br />
</body><br />
</html><br />




这是ck.php

<br>
[code=php]<br>
<br>
<br>
	<meta><br>
	<title>
<br>
        ckeditor与ckfinder的配置和调用<br>
	</title><br>
<script></script> <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn