Kan mir jemand Helfen brauche eine weiterleitung stat per e-mail solte die SMS per $_GET an eine URL Weitergeleitet werdeb hir mein Php Code:
Alles anzeigen
Quellcode
- <?php
- include "../class/includes.php";
- $apimysql=new api_mysql();
- $tools = new api_tools();
- $apiuser = new api_user();
- $mailing = new api_mailing();
- /**
- * RECIVE SMS BEGIN
- */
- $messagex = str_replace("%20", " ", $_GET['text']);
- $req_array = explode(" ", $messagex);
- $data['keyword'] = $req_array[0];
- $data['subkeyword'] = $req_array[1];
- $data['country'] = $_GET['country'];
- $data['message'] = $messagex;
- $data['phone'] = $_GET['msisdn'];
- $data['datum'] = date("Y-m-d H:i:s");
- $data['mno'] = $_GET['mno'];
- $data['shortid'] = $_GET['shortcode'];
- ////////// RECIVE SMS END ////////////
- /**
- * ACCESS CONTROL BEGIN
- */
- if ($_GET['PWD'] != "") {
- echo "Zutritt verweigert!";
- mail("xxx@xxx.com","not authorized accessed on Globsat - Zong Incomming", $_SERVER['REMOTE_ADDR'],"FROM:system@xxx.com; xxxx@xxxx.com");
- exit;
- }
- /**
- * ACCESS CONTROL END
- */
- //$data['phone'] = (int)$data['phone'];
- $countrynumber = str_replace("+","",$data['phone']);
- $countrynumber = str_replace("00","",$countrynumber);
- include "numbers.php";
- foreach($_numbers as $key => $value) {
- if(preg_match("/^$value/", $countrynumber)) {
- $data['country'] = $key;
- break;
- }
- }
- /**
- * ZUSTENDIG FÜR DIE WEITERLEITUNG PER E-mail
- */
- if (VIP){
- $get_id = $apimysql->Fields(TABLE_KEYWORDS, array("keyword"=>VIP));
- $get_user = $apimysql->Fields(TABLE_KEYWORDS_USER, array("keyword_id"=>$get_id[0]['id'], "subkeyword"=>$data['subkeyword']));
- $data['uid'] = $get_user[0]['uid'];
- $keyword = $tools->getIdByKeyword($data['keyword']);
- $uredirectmail = $apiuser->getRedirectMailBySubkey($keyword['id'], $data['subkeyword']);
- $data['keyword_id'] = $keyword['id'];
- //print_r($data['keyword_id']);
- $data['price'] = $tools->getPrice($data['keyword_id'], $data['country'], $data['uid']);
- $subj = "COUNTRY: ".$data['country']." KEYWORD: ".$data['keyword']." ".$data['subkeyword']." PHONE: ".$data['phone']." DATE: ".$data['datum'];
- if($uredirectmail) $mailing->mailto($uredirectmail,"SMS2Radio $subj", "mail_redirect.txt", $data);
- $sql = $apimysql->createInsert(TABLE_MESSAGES, $data);
- $apimysql->DoSql($sql);
- } else {
- echo "FAILED";
- }
- // Write logfile
- $this_site = str_replace("/incoming/", "", $_SERVER['PHP_SELF']);
- //$qstring = str_replace("%20", " ", $_SERVER['QUERY_STRING']);
- foreach($_GET as $key => $val)
- $qstring .= $key."=".$_GET[$key]."&";
- $fullrequest = "<? \$REQUEST= \"\n".date("Y-m-d H:i:s")."\n".$qstring."\n\";?>\n\n";
- $filename = "log/log_".$this_site;
- if (!$handle = fopen($filename, "a")) {
- print "Kann die Datei $filename nicht ?fnen";
- }
- if (!fwrite($handle, $fullrequest)) {
- print "Kann in die Datei $filename nicht schreiben";
- } else {
- chmod($filename, 0666);
- }
- fclose($handle);
- $apimysql->CloseCon();
- print <<<END
- <?xml version="1.0" encoding="UTF-8"?>
- <oneoff_response xmlns="https://xxxx.com/vr2" reverse_charged="true" fragmentable="false"> <text_content>Thank you for your Message! Services </text_content>
- </oneoff_response>
- END;
- ?>