I've been writing python for two days.
Active defense system has been missing a send SMS message notification function, so try to write a PHP to do the background module
//Lian$link= Mysql_connect (sae_mysql_host_m.':'. Sae_mysql_port,sae_mysql_user,sae_mysql_pass);if($link) {mysql_select_db (sae_mysql_db,$link);$getid= mysql_query ("select Max (id_p) from--your_datatable--");$row= Mysql_fetch_array ($getid);$id=$row[0]+1;$content= Addslashes ($_post[' content ']);$token= Addslashes ($_post[' token ']);if($content) {if($token=="--your_token--") {mysql_query ("INSERT into '--your_database--'. '--your_datatable--' (' id_p ', ' Content ') VALUES (' $id ', ' $content ')");$smsapi="--sms_gateway--";//SMS Gateway$user="--sms_account--";//SMS Platform account$pass="--sms_password--";//SMS Platform password$content=" Active Defense" Sir, I get some thing: ".$content;//SMS content to be sent$sendurl=$smsapi."sms?u=".$user."&p=".$pass."&m="."--your_phone--"."&c=". UrlEncode ($content);$result= File_get_contents ($sendurl) ; }Else{$msg="token wrong!".$content; mysql_query ("INSERT into '--your_database--'. '--your_datatable--' (' id_p ', ' Content ') VALUES (' $id ', ' $msg ')"); }} mysql_close ($link); }Echo"Hello
";?>
Python writes the front-end very simple, because later is to integrate into the active defense API inside, did not add those fancy things.
# -*- coding: utf-8 -*-import urllib2import urllibdata = {}data['token''--YOUR_TOKEN--'data['content''--YOUR_MESSAGE--'"--PHP_ADDRESS--"post_data = urllib.urlencode(data)req = urllib2.urlopen(url, post_data)print ("Finish")
That's the way it is, it's going to be an exam next week, and the defense system has to be put down.
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the use of PHP server to complete the SMS message forwarding, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.