<textarea></textarea>里面的内容获取不了!$_post[]方法,急急急!
<?phpif($_POST['submit']){$content=$_POST['content'];echo"<script>alert('$content');<...
<?php
if($_POST['submit']){
$content=$_POST['content'];
echo "<script>alert('$content');</script>"
}
?>
<style>
form {
margin: 0;
}
textarea {
display: block;
}
</style>
<link rel="stylesheet" href="kindeditor/themes/default/default.css" />
<script charset="utf-8" src="kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});
});
</script>
</HEAD>
<BODY>
<form action="addnews.php" method="post" >
<textarea name="content" style="width:80%;height:450px;visibility: hidden;"></textarea>
<input name="submit" type="submit" value="提 交"></div>
</form>
</BODY>
</HTML>
对textarea加了以下代码后就传不了值!求解!(把textarea修饰成文本编辑器)
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});
});
</script> 展开
if($_POST['submit']){
$content=$_POST['content'];
echo "<script>alert('$content');</script>"
}
?>
<style>
form {
margin: 0;
}
textarea {
display: block;
}
</style>
<link rel="stylesheet" href="kindeditor/themes/default/default.css" />
<script charset="utf-8" src="kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="kindeditor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});
});
</script>
</HEAD>
<BODY>
<form action="addnews.php" method="post" >
<textarea name="content" style="width:80%;height:450px;visibility: hidden;"></textarea>
<input name="submit" type="submit" value="提 交"></div>
</form>
</BODY>
</HTML>
对textarea加了以下代码后就传不了值!求解!(把textarea修饰成文本编辑器)
<script>
var editor;
KindEditor.ready(function(K) {
editor = K.create('textarea[name="content"]', {
resizeType : 1,
allowPreviewEmoticons : false,
allowImageUpload : false,
items : [
'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
'insertunorderedlist', '|', 'emoticons', 'image', 'link']
});
});
</script> 展开
1个回答
2015-04-24
展开全部
你写的有问题,在你基础上改装了啊。可以运行
截图:
<?php
header("content-type:text/html;charset=utf-8");
//print_r($_POST);
//if($_SERVER['REQUEST_METHOD']=='post'){
if(isset($_POST['content'])){
//var_dump($_POST);
//exit();
$content=$_POST['content'];
echo "<script>alert('$content');</script>";
}
?>
<style>
form {
margin: 0;
}
textarea {
display: block;
}
</style>
</HEAD>
<BODY>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" >
<textarea name="content" style="width:80%;height:450px;"></textarea>
<input name="submit" type="submit" value="提 交"></div>
</form>
</BODY>
</HTML>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询