为什么取两次, 然后$_get $_post在这里的区别是?

harveymorning harveymorning 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<?php
include ('include_fns.php');
$title=$_POST['title'];
$poster=$_POST['poster'];
$message=$_POST['message'];
if (isset($_GET['parent'])){
$parent=$_GET['parent'];
}else{
$parent=$_POST['parent'];
}
if (!$error){
if (!$parent){
$parent=0;
if (!$title){
$title='New Post';
}
}else{
//get post name
$title=get_post_title($parent);
//append Re:
if (strstr($title,'Re: ')==false){
$title='Re: '.$title;
}
//make sure title will still fit in db
$title=substr($title,0,20);
//prepend a quoting pattern to the post you are replying to
$message=add_quoting(get_post_message($parent));
}
}
do_html_header($title);
display_new_post_form($parent,$area,$title,$message,$poster);
if ($error){
echo "<p>Your message was not stored.</p>
<p>Make sure you have filled in all fields and try again.</p>";
}
do_html_footer();
...全文

相关推荐

php中$_GET和$_POST方法详解

详细介绍了php中$_GET和$_POST的用法,对php初学者有很大的帮助

关二爷在上

jQuery Ajax之$.get()方法和$.post()方法

注意:$.get()和$.post()方法是jQuery中的全局函数。前面讲到的load()方式是对jQuery对象进行操作的。 1、 $.get()方法   $.get()方法使用GET方式来进行异步请求。   它的语法结构为:   $.get( url [, data] [, callback] [, type] )   $.get()方法参数解释如下表: 参数名称 类 型 说  明 url String 请求的HTML页的URL地址 data(可选) Object 发送至服务器的key/value数据会作为QueryString附加到请求URL中 callback(可选)

Yoo?

jQuery的3种请求方式$.post,$.get,$.getJSON

$.post,$.get,$.getJSON是jQuery的3种请求方式 1、$.get就是get方式提交数据,用法:$.get(url,data,callback),例: 代码如下: $.get(“../saveUser.action”,{ ‘userId’:123, ‘userCode’:’123′ },function(data)){} 2、$.post就是post提交,一般来说,相对比较安全,用法:$.post(url,data,callback),例: 代码如下: $.post(“../saveUser.action”,{ ‘userId’:123, ‘userCode’:’1

weixin_38660295

解决JQurey跨域问题$.get|$.post|$.getJSON等等统统可跨域

解决JQurey跨域问题$.get|$.post|$.getJSON等等统统可跨域

sohog

Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法总结

详细解读Jquery各Ajax函数: $.get(),$.post(),$.ajax(),$.getJSON() 一,$.get(url,[data],[callback]) 说明:url为请求地址,data为请求数据的列表,callback为请求成功后的回调函数,该函数接受两个参数,第一个为服务器返回的数据,第二个参数为服务器的状态,是可选参数。 而其中,服务器返回数据的格式其实是字符串形势,并不是我们想要的json数据格式,在此引用只是为了对比说明 代码如下: $.get(“data.php”,$(“#firstName.val()”),function(data){ $(“#getRe

weixin_38607479
评论 6
收藏 已收藏
分享
返回顶部
harveymorning
基础编程 21,889 成员 140,329 内容