1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > asp发送短信功能怎么改成php的 有asp例子 求教

asp发送短信功能怎么改成php的 有asp例子 求教

时间:2024-01-16 16:38:17

相关推荐

asp发送短信功能怎么改成php的 有asp例子 求教

后端开发|php教程

asp发送短信功能怎么改成php的,asp例子,求教

后端开发-php教程

手机任务赚钱网源码,ipad支持vscode吗,ubuntu搭建ca,tomcat怎样配置时间,sqlite3删除字符串,百度爬虫名称是什么意思,php 检测函数,搜狗蜘蛛池seo推广,b2b网站软件,list不是模板lzw

If vercode > "" Thenemail = "接口短信的用户账号"SMS_PASSWORD = "接口短信的用户密码"DescURL = "/api/send.asp" //接口地址Set objHTTP = Server.CreateObject("MSXML2.XMLHTTP")Call objHTTP.Open("POST", DescURL, FALSE)PostData = "email="+email+"&Password="+SMS_PASSWORD+"&MsgContent="+((MsgContent))+"&mobileNumber="+ m +"&SendTime="+SendTime+"&SubNumber="+ SubNumber //一些上边的变量拼接,有用户名,密码,发送手机号等Response.Write postdataCall objHTTP.SetRequestHeader("Content-Type","text/html; charset=uft-8")Call objHTTP.open("GET",DescURL & "?" & PostData, false)Call objHTTP.send()end if

这是asp的写法,有点别扭。 要换成php怎么写啊?先谢谢了!

dll注入 源码,vscode怎么看运行错误,ubuntu文件清理,tomcat部署远程war,爬虫 网址循环,php移动端开发框架,深圳seo云哥霸屏推广,啤酒网站模板lzw

回复讨论(解决方案)

瓦力抢红包源码,vscode老是报错,手机怎么访问ubuntu,tomcat.conf,sqlite视图查询,svgmap 插件使用说明,华为前端用的框架,爬虫的祖先,php 变量赋值给变量,智能seo优化排名,网站模版源代码从哪下载,html5网页字体格式,租车网站响应式模板,大商创 商家入驻页面修改,windows 虚拟主机管理系统,免费网址导航程序lzw

用curl类似的

file_get_contents($url);

authentication = 0; if($use == true) $this->authentication = 1;}public function setName($name){ $this->auth_name = $name;}public function setPass($pass){ $this->auth_pass = $pass;}public function __construct($url,$followlocation = true,$timeOut = 30,$maxRedirecs = 4,$binaryTransfer = false,$includeHeader = false,$noBody = false){ $this->_url = $url; $this->_followlocation = $followlocation; $this->_timeout = $timeOut; $this->_maxRedirects = $maxRedirecs; $this->_noBody = $noBody; $this->_includeHeader = $includeHeader; $this->_binaryTransfer = $binaryTransfer;$this->_cookieFileLocation = dirname(__FILE__)./cookie.txt;}public function setReferer($referer){ $this->_referer = $referer;}public function setCookiFileLocation($path){ $this->_cookieFileLocation = $path;}public function setPost ($postFields){ $this->_post = true; $this->_postFields = $postFields;}public function setUserAgent($userAgent){ $this->_useragent = $userAgent;}public function createCurl($url = ul){ if($url != ul){$this->_url = $url; }$s = curl_init();curl_setopt($s,CURLOPT_URL,$this->_url); curl_setopt($s,CURLOPT_HTTPHEADER,array(Expect:)); curl_setopt($s,CURLOPT_TIMEOUT,$this->_timeout); curl_setopt($s,CURLOPT_MAXREDIRS,$this->_maxRedirects); curl_setopt($s,CURLOPT_RETURNTRANSFER,true); curl_setopt($s,CURLOPT_FOLLOWLOCATION,$this->_followlocation); curl_setopt($s,CURLOPT_COOKIEJAR,$this->_cookieFileLocation); curl_setopt($s,CURLOPT_COOKIEFILE,$this->_cookieFileLocation);if($this->authentication == 1){ curl_setopt($s, CURLOPT_USERPWD, $this->auth_name.:.$this->auth_pass); } if($this->_post) { curl_setopt($s,CURLOPT_POST,true); curl_setopt($s,CURLOPT_POSTFIELDS,$this->_postFields);}if($this->_includeHeader) {curl_setopt($s,CURLOPT_HEADER,true); }if($this->_noBody) { curl_setopt($s,CURLOPT_NOBODY,true); } /* if($this->_binary) { curl_setopt($s,CURLOPT_BINARYTRANSFER,true); } */ curl_setopt($s,CURLOPT_USERAGENT,$this->_useragent); curl_setopt($s,CURLOPT_REFERER,$this->_referer);$this->_webpage = curl_exec($s); $this->_status = curl_getinfo($s,CURLINFO_HTTP_CODE); curl_close($s);} public function getHttpStatus() { return $this->_status; } public function __tostring(){return $this->_webpage; }} $m=new mycurl("/api/send.asp"); //一些上边的变量拼接,有用户名,密码,发送手机号$m->setPost(Array("email"=> $email, "Password"=> $SMS_PASSWORD,"MsgContent"=> $MsgContent,"mobileNumber"=> $mobileNumber,"SendTime"=> $SendTime,"SubNumber"=> $SubNumber ));$m->createCurl();?>

你看这样是否能用

你看这样是否能用

怎么调用啊? 小弟不才, 我用的CI框架,这个类,我怎么让他执行,谢谢!

调用send方法,在方法中包含进来你写的文件,把信息都填好了。出现

Fatal error: Call to undefined function curl_init() in D:\Program\wamp\\application\controllers\mycurl.php on line 75

开启WAMP环境的cURL扩展

<!–/*! This file is auto-generated */!function(c,d){"use strict";var e=!1,n=!1;if(d.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},!c.wp.receiveEmbedMessage)if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,a,i,s=d.querySelectorAll(iframe[data-secret="+t.secret+\"]),n=d.querySelectorAll(lockquote[data-secret="+t.secret+\"]),o=0;o<n.length;o++)n[o].style.display="none";for(o=0;o<s.length;o++)if(r=s[o],e.source===r.contentWindow){if(r.removeAttribute("style"),"height"===t.message){if(1e3<(i=parseInt(t.value,10)))i=1e3;else if(~~i<200)i=200;r.height=i}if("link"===t.message)if(a=d.createElement("a"),i=d.createElement("a"),a.href=r.getAttribute("src"),i.href=t.value,i.host===a.host)if(d.activeElement===r)c.top.location.href=t.value}}},e)c.addEventListener("message",c.wp.receiveEmbedMessage,!1),d.addEventListener("DOMContentLoaded",t,!1),c.addEventListener("load",t,!1);function t(){if(!n){n=!0;for(var e,t,r=-1!==navigator.appVersion.indexOf("MSIE 10"),a=!!navigator.userAgent.match(/Trident.*rv:11./),i=d.querySelectorAll("iframe.wp-embedded-content"),s=0;s

函数里面定义类,初始化,这倒是也可以工作。

建议参考下 /user_guide/general/creating_libraries.html

Fatal error: Call to undefined function curl_init()

这个错误需要你把php.ini配置文件中的

;extension=php_curl.dll

前面的;去掉

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。