Advertisement
Guest User

index.php

a guest
Oct 4th, 2012
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 60.03 KB | None | 0 0
  1. <?php
  2.     //
  3.     //echo(__LINE__ . "<BR />");
  4.     //error_reporting(E_ALL);
  5.     error_reporting(0);
  6.     //mb_internal_encoding("UTF-8");
  7.  
  8.     session_start();
  9.     include("languages.php");
  10.    
  11.   $brokenUtf8ToUtf8 = array(
  12.         "\xc2\x80" => "\xe2\x82\xac",
  13.  
  14.         "\xc2\x82" => "\xe2\x80\x9a",
  15.         "\xc2\x83" => "\xc6\x92",
  16.         "\xc2\x84" => "\xe2\x80\x9e",
  17.         "\xc2\x85" => "\xe2\x80\xa6",
  18.         "\xc2\x86" => "\xe2\x80\xa0",
  19.         "\xc2\x87" => "\xe2\x80\xa1",
  20.         "\xc2\x88" => "\xcb\x86",
  21.         "\xc2\x89" => "\xe2\x80\xb0",
  22.         "\xc2\x8a" => "\xc5\xa0",
  23.         "\xc2\x8b" => "\xe2\x80\xb9",
  24.         "\xc2\x8c" => "\xc5\x92",
  25.  
  26.         "\xc2\x8e" => "\xc5\xbd",
  27.  
  28.  
  29.         "\xc2\x91" => "\xe2\x80\x98",
  30.         "\xc2\x92" => "\xe2\x80\x99",
  31.         "\xc2\x93" => "\xe2\x80\x9c",
  32.         "\xc2\x94" => "\xe2\x80\x9d",
  33.         "\xc2\x95" => "\xe2\x80\xa2",
  34.         "\xc2\x96" => "\xe2\x80\x93",
  35.         "\xc2\x97" => "\xe2\x80\x94",
  36.         "\xc2\x98" => "\xcb\x9c",
  37.         "\xc2\x99" => "\xe2\x84\xa2",
  38.         "\xc2\x9a" => "\xc5\xa1",
  39.         "\xc2\x9b" => "\xe2\x80\xba",
  40.         "\xc2\x9c" => "\xc5\x93",
  41.  
  42.         "\xc2\x9e" => "\xc5\xbe",
  43.         "\xc2\x9f" => "\xc5\xb8"
  44.   );
  45.  
  46.   function toUTF8($text){
  47.   /**
  48.    * Function Encoding::toUTF8
  49.    *
  50.    * This function leaves UTF8 characters alone, while converting almost all non-UTF8 to UTF8.
  51.    *
  52.    * It assumes that the encoding of the original string is either Windows-1252 or ISO 8859-1.
  53.    *
  54.    * It may fail to convert characters to UTF-8 if they fall into one of these scenarios:
  55.    *
  56.    * 1) when any of these characters:   ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß
  57.    *    are followed by any of these:  ("group B")
  58.    *                                    Â¡Â¢Â£Â¤Â¥Â¦Â§Â¨Â©ÂªÂ«Â¬Â­Â®Â¯Â°Â±Â²Â³Â´ÂµÂ¶â€¢Â¸Â¹ÂºÂ»Â¼Â½Â¾Â¿
  59.    * For example:   %ABREPRESENT%C9%BB. «REPRESENTÉ»
  60.    * The "«" (%AB) character will be converted, but the "É" followed by "»" (%C9%BB)
  61.    * is also a valid unicode character, and will be left unchanged.
  62.    *
  63.    * 2) when any of these: àáâãäåæçèéêëìíîï  are followed by TWO chars from group B,
  64.    * 3) when any of these: ðñòó  are followed by THREE chars from group B.
  65.    *
  66.    * @name toUTF8
  67.    * @param string $text  Any string.
  68.    * @return string  The same string, UTF8 encoded
  69.    *
  70.    */
  71.  
  72.     if(is_array($text))
  73.     {
  74.       foreach($text as $k => $v)
  75.       {
  76.         $text[$k] = toUTF8($v);
  77.       }
  78.       return $text;
  79.     } elseif(is_string($text)) {
  80.  
  81.       $max = strlen($text);
  82.       $buf = "";
  83.       for($i = 0; $i < $max; $i++){
  84.           $c1 = $text{$i};
  85.           if($c1>="\xc0"){ //Should be converted to UTF8, if it's not UTF8 already
  86.             $c2 = $i+1 >= $max? "\x00" : $text{$i+1};
  87.             $c3 = $i+2 >= $max? "\x00" : $text{$i+2};
  88.             $c4 = $i+3 >= $max? "\x00" : $text{$i+3};
  89.               if($c1 >= "\xc0" & $c1 <= "\xdf"){ //looks like 2 bytes UTF8
  90.                   if($c2 >= "\x80" && $c2 <= "\xbf"){ //yeah, almost sure it's UTF8 already
  91.                       $buf .= $c1 . $c2;
  92.                       $i++;
  93.                   } else { //not valid UTF8.  Convert it.
  94.                       $cc1 = (chr(ord($c1) / 64) | "\xc0");
  95.                       $cc2 = ($c1 & "\x3f") | "\x80";
  96.                       $buf .= $cc1 . $cc2;
  97.                   }
  98.               } elseif($c1 >= "\xe0" & $c1 <= "\xef"){ //looks like 3 bytes UTF8
  99.                   if($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf"){ //yeah, almost sure it's UTF8 already
  100.                       $buf .= $c1 . $c2 . $c3;
  101.                       $i = $i + 2;
  102.                   } else { //not valid UTF8.  Convert it.
  103.                       $cc1 = (chr(ord($c1) / 64) | "\xc0");
  104.                       $cc2 = ($c1 & "\x3f") | "\x80";
  105.                       $buf .= $cc1 . $cc2;
  106.                   }
  107.               } elseif($c1 >= "\xf0" & $c1 <= "\xf7"){ //looks like 4 bytes UTF8
  108.                   if($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf"){ //yeah, almost sure it's UTF8 already
  109.                       $buf .= $c1 . $c2 . $c3;
  110.                       $i = $i + 2;
  111.                   } else { //not valid UTF8.  Convert it.
  112.                       $cc1 = (chr(ord($c1) / 64) | "\xc0");
  113.                       $cc2 = ($c1 & "\x3f") | "\x80";
  114.                       $buf .= $cc1 . $cc2;
  115.                   }
  116.               } else { //doesn't look like UTF8, but should be converted
  117.                       $cc1 = (chr(ord($c1) / 64) | "\xc0");
  118.                       $cc2 = (($c1 & "\x3f") | "\x80");
  119.                       $buf .= $cc1 . $cc2;
  120.               }
  121.           } elseif(($c1 & "\xc0") == "\x80"){ // needs conversion
  122.                 if(isset($win1252ToUtf8[ord($c1)])) { //found in Windows-1252 special cases
  123.                     $buf .= $win1252ToUtf8[ord($c1)];
  124.                 } else {
  125.                   $cc1 = (chr(ord($c1) / 64) | "\xc0");
  126.                   $cc2 = (($c1 & "\x3f") | "\x80");
  127.                   $buf .= $cc1 . $cc2;
  128.                 }
  129.           } else { // it doesn't need convesion
  130.               $buf .= $c1;
  131.           }
  132.       }
  133.       return $buf;
  134.     } else {
  135.       return $text;
  136.     }
  137.   }
  138.  
  139.  
  140.   function UTF8FixWin1252Chars($text){
  141.     // If you received an UTF-8 string that was converted from Windows-1252 as it was ISO8859-1
  142.     // (ignoring Windows-1252 chars from 80 to 9F) use this function to fix it.
  143.     // See: http://en.wikipedia.org/wiki/Windows-1252
  144.  
  145.     return str_replace(array_keys($brokenUtf8ToUtf8), array_values($brokenUtf8ToUtf8), $text);
  146.   }
  147.  
  148.   function removeBOM($str=""){
  149.     if(substr($str, 0,3) == pack("CCC",0xef,0xbb,0xbf)) {
  150.       $str=substr($str, 3);
  151.     }
  152.     return $str;
  153.   }
  154.     function lng($which)
  155.     {
  156.         global $ARRXKS;
  157.         return $ARRXKS[$_SESSION['lang']]["$which"];
  158.     }
  159.  
  160.     function LangChoose()
  161.     {
  162.         echo('
  163.             <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  164.             <html xmlns="http://www.w3.org/1999/xhtml" lang="pl-PL">
  165.             <head>
  166.             <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  167.             <title>Meet-Helmond.nl SMS Service - Free Worldwide SMS Sending | Select your Language</title>
  168.             <link href="css.css" rel="stylesheet" type="text/css" />
  169.             </head>
  170. <!-- Send free sms worldwide
  171. Send free sms around the world
  172. gratis sms in nederland
  173. gratis sms naar nederland
  174. gratis sms wereldwijd
  175. -->
  176.                 <div class="information">
  177.                 <div class="boxinfo">Cookies MUST be enabled to use this website!</div>
  178.                 <p>
  179.                 <form id="loginForm" name="loginForm" method="post" action="index.php">');
  180.                 //echo('<BR />');
  181.                 //print_r($_GET);
  182.                 //echo('<BR />');
  183.                 global $ARRXKS;
  184.                 $LANG_keys = array_keys($ARRXKS);
  185.                 $count = 1;
  186.                 for ($i = 0; $i <= count($ARRXKS) - 1; $i++)
  187.                 {
  188.                     echo('<a href="index.php?uselang='.$LANG_keys[$i].'"><img border="0" src="images/flags/'.$LANG_keys[$i].'.png" name="abc" id="def" value="'.$LANG_keys[$i].'" alt="'.$LANG_keys[$i].'"></img></a>');
  189.                     if((($count) % 5) == 0)
  190.                     {
  191.                         echo('<BR />');
  192.                     }
  193.                     $count = $count + 1;
  194.                 }
  195.                 echo('
  196.                 </form>
  197.                 </div>
  198.             <body>
  199.             </body>
  200.             </html>
  201.         ');
  202.     }
  203.     //print_r($_POST);
  204.     if(!isset($_SESSION['lang']))
  205.     {
  206.         if(isset($_GET['uselang']))
  207.         {
  208.             if(isset($ARRXKS[$_GET['uselang']]["robot"]))
  209.             {
  210.                 $_SESSION['lang'] = $_GET['uselang'];
  211.             }
  212.             else
  213.             {
  214. LangChoose();
  215. exit();
  216.             }
  217.         }
  218.         else
  219.         {
  220. LangChoose();
  221. exit();
  222.         }
  223.     }
  224.      
  225.     $database['address'] = "hh";//"127.0.0.1";//host
  226.     $database['user'] = "hh";//"root";//username
  227.     $database['name'] = "hh";//"ucp";//database name
  228.     $database['password'] = "hh";//password for user@DB
  229. //echo(__LINE__ . "<BR />");
  230.     $database['link'] = mysql_connect($database['address'], $database['user'], $database['password']);
  231.     if (!$database['link']) {
  232.         die('Could not connect to MySQL Server.');
  233.     }
  234.     $database['selected'] = mysql_select_db($database['name'], $database['link']);
  235.     if (!$database['selected']) {
  236.         die ('Can\'t use provided database.');
  237.     }
  238.     //
  239. //echo(__LINE__ . "<BR />");
  240.     if(!isset($_SESSION['CurrPage']))
  241.     {
  242.         $_SESSION['CurrPage'] = "LoginIndex";
  243.     }
  244.      
  245.     if(!isset($_SESSION['Rec']))
  246.     {
  247.         $_SESSION['Rec'] = "login";
  248.     }
  249.     if(isset($_GET['action']))
  250.     {
  251.         $action = $_GET['action'];
  252.     }
  253.     else
  254.     {
  255.         $action = "x";
  256.     }
  257.     $errorMessage = "x";
  258. //echo(__LINE__ . "<BR />");
  259.     function quote_smart($value, $handle) {
  260.        if (get_magic_quotes_gpc()) {
  261.            $value = stripslashes($value);
  262.        }
  263.        if (!is_numeric($value)) {
  264.            $value = "'" . mysql_real_escape_string($value, $handle) . "'";
  265.        }
  266.        return $value;
  267.     }
  268. /**
  269. * Check email address validity
  270. * @param   strEmailAddress     Email address to be checked
  271. * @return  True if email is valid, false if not
  272. */
  273. function email_valid($strEmailAddress) {
  274. // If magic quotes is "on", email addresses with quote marks will
  275. // fail validation because of added escape characters. Uncommenting
  276. // the next three lines will allow for this issue.
  277. //if (get_magic_quotes_gpc()) {
  278. //    $strEmailAddress = stripslashes($strEmailAddress);
  279. //}
  280. // Control characters are not allowed
  281. if (preg_match('/[\x00-\x1F\x7F-\xFF]/', $strEmailAddress)) {
  282. return false;
  283. }
  284. // Check email length - min 3 (a@a), max 256
  285. if (!check_text_length($strEmailAddress, 3, 256)) {
  286. return false;
  287. }
  288. // Split it into sections using last instance of "@"
  289. $intAtSymbol = strrpos($strEmailAddress, '@');
  290. if ($intAtSymbol === false) {
  291. // No "@" symbol in email.
  292. return false;
  293. }
  294. $arrEmailAddress[0] = substr($strEmailAddress, 0, $intAtSymbol);
  295. $arrEmailAddress[1] = substr($strEmailAddress, $intAtSymbol + 1);
  296. // Count the "@" symbols. Only one is allowed, except where
  297. // contained in quote marks in the local part. Quickest way to
  298. // check this is to remove anything in quotes. We also remove
  299. // characters escaped with backslash, and the backslash
  300. // character.
  301. $arrTempAddress[0] = preg_replace('/\./'
  302. ,''
  303. ,$arrEmailAddress[0]);
  304. $arrTempAddress[0] = preg_replace('/"[^"]+"/'
  305. ,''
  306. ,$arrTempAddress[0]);
  307. $arrTempAddress[1] = $arrEmailAddress[1];
  308. $strTempAddress = $arrTempAddress[0] . $arrTempAddress[1];
  309. // Then check - should be no "@" symbols.
  310. if (strrpos($strTempAddress, '@') !== false) {
  311. // "@" symbol found
  312. return false;
  313. }
  314. // Check local portion
  315. if (!check_local_portion($arrEmailAddress[0])) {
  316. return false;
  317. }
  318. // Check domain portion
  319. if (!check_domain_portion($arrEmailAddress[1])) {
  320. return false;
  321. }
  322. // If we're still here, all checks above passed. Email is valid.
  323. return true;
  324. }
  325. //echo(__LINE__ . "<BR />");
  326. /**
  327. * Checks email section before "@" symbol for validity
  328. * @param   strLocalPortion     Text to be checked
  329. * @return  True if local portion is valid, false if not
  330. */
  331. function check_local_portion($strLocalPortion) {
  332. // Local portion can only be from 1 to 64 characters, inclusive.
  333. // Please note that servers are encouraged to accept longer local
  334. // parts than 64 characters.
  335. if (!check_text_length($strLocalPortion, 1, 64)) {
  336. return false;
  337. }
  338. // Local portion must be:
  339. // 1) a dot-atom (strings separated by periods)
  340. // 2) a quoted string
  341. // 3) an obsolete format string (combination of the above)
  342. $arrLocalPortion = explode('.', $strLocalPortion);
  343. for ($i = 0, $max = sizeof($arrLocalPortion); $i < $max; $i++) {
  344. if (!preg_match('.^('
  345. .    '([A-Za-z0-9!#$%&\'*+/=?^_`{|}~-]'
  346. .    '[A-Za-z0-9!#$%&\'*+/=?^_`{|}~-]{0,63})'
  347. .'|'
  348. .    '("[^\\\"]{0,62}")'
  349. .')$.'
  350. ,$arrLocalPortion[$i])) {
  351. return false;
  352. }
  353. }
  354. return true;
  355. }
  356. /**
  357. * Checks email section after "@" symbol for validity
  358. * @param   strDomainPortion     Text to be checked
  359. * @return  True if domain portion is valid, false if not
  360. */
  361. function check_domain_portion($strDomainPortion) {
  362. // Total domain can only be from 1 to 255 characters, inclusive
  363. if (!check_text_length($strDomainPortion, 1, 255)) {
  364. return false;
  365. }
  366. // Check if domain is IP, possibly enclosed in square brackets.
  367. if (preg_match('/^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])'
  368. .'(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}$/'
  369. ,$strDomainPortion) ||
  370. preg_match('/^\[(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])'
  371. .'(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}\]$/'
  372. ,$strDomainPortion)) {
  373. return true;
  374. } else {
  375. $arrDomainPortion = explode('.', $strDomainPortion);
  376. if (sizeof($arrDomainPortion) < 2) {
  377. return false; // Not enough parts to domain
  378. }
  379. for ($i = 0, $max = sizeof($arrDomainPortion); $i < $max; $i++) {
  380. // Each portion must be between 1 and 63 characters, inclusive
  381. if (!check_text_length($arrDomainPortion[$i], 1, 63)) {
  382. return false;
  383. }
  384. if (!preg_match('/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|'
  385. .'([A-Za-z0-9]+))$/', $arrDomainPortion[$i])) {
  386. return false;
  387. }
  388. if ($i == $max - 1) { // TLD cannot be only numbers
  389. if (strlen(preg_replace('/[0-9]/', '', $arrDomainPortion[$i])) <= 0) {
  390. return false;
  391. }
  392. }
  393. }
  394. }
  395. return true;
  396. }
  397. /**
  398. * Check given text length is between defined bounds
  399. * @param   strText     Text to be checked
  400. * @param   intMinimum  Minimum acceptable length
  401. * @param   intMaximum  Maximum acceptable length
  402. * @return  True if string is within bounds (inclusive), false if not
  403. */
  404. function check_text_length($strText, $intMinimum, $intMaximum) {
  405. // Minimum and maximum are both inclusive
  406. $intTextLength = strlen($strText);
  407. if (($intTextLength < $intMinimum) || ($intTextLength > $intMaximum)) {
  408. return false;
  409. } else {
  410. return true;
  411. }
  412. }
  413. //echo(__LINE__ . "<BR />");
  414.     switch($_SESSION['CurrPage'])
  415.     {
  416.         case "LoginIndex":
  417.         {
  418.             //echo(__LINE__ . "<BR />");
  419.             $uname = "";
  420.             $pword = "";
  421.             $errorMessage = "x";
  422.             //==========================================
  423.             //  ESCAPE DANGEROUS SQL CHARACTERS
  424.             //==========================================
  425.             if ($_SERVER['REQUEST_METHOD'] == 'POST')
  426.             {
  427.                 //echo(__LINE__ . "<BR />");
  428.                 if($_POST['loginaction'] == "Login")
  429.                 {
  430.                     if (md5($_POST['norobot']) == $_SESSION['randomnr2'])
  431.                     {
  432.                         //echo(__LINE__ . "<BR />");
  433.                         $uname = $_POST['username'];
  434.                         $pword = $_POST['password'];
  435.                         $uname = quote_smart($uname, $database['link']);
  436.                         $pword = strtoupper(hash("whirlpool",$pword));
  437.                         $SQL = "SELECT * FROM `sms_accounts` WHERE `Email` = $uname AND `Password` = '$pword'";
  438.                         $result = mysql_query($SQL,$database['link']);
  439.                     //====================================================
  440.                     //  CHECK TO SEE IF THE $result VARIABLE IS TRUE
  441.                     //====================================================
  442.                         //echo(__LINE__ . "<BR />");
  443.                         if ($result)
  444.                         {
  445.                             //echo(__LINE__ . "<BR />");
  446.                             $num_rows = @mysql_num_rows($result);
  447.                             if ($num_rows > 0)
  448.                             {
  449.                                 //echo(__LINE__ . "<BR />");
  450.                                 $row = mysql_fetch_array($result, MYSQL_ASSOC);
  451.                                 $_SESSION['login'] = "1";
  452.                                 $_SESSION['index'] = $row["id"];
  453.                                 $_SESSION['credits'] = $row["credits"];
  454.                                 $_SESSION['Email'] = $row["Email"];
  455.                                 $_SESSION['CurrPage'] = "UserIndex";
  456.                                 $_SESSION['Rec'] = "default";
  457.                                 $_SESSION['LoginTime'] = time();
  458.                             }
  459.                             else
  460.                             {
  461.                                 //echo(__LINE__ . "<BR />");
  462.                                 $errorMessage = lng("wrongemailpasswd");
  463.                             }
  464.                         }
  465.                         else
  466.                         {
  467.                             //echo(__LINE__ . "<BR />");
  468.                             $errorMessage = lng("uknerr");
  469.                         }
  470.                     }
  471.                     else
  472.                     {
  473.                         $errorMessage = lng("robot");
  474.                     }
  475.                     $_SESSION['Rec'] = "login";
  476.                     //echo(__LINE__ . "<BR />");
  477.                 }else
  478.                 if($_POST['loginaction'] == "Register")
  479.                 {
  480.                 //echo(__LINE__ . "<BR />");
  481.                     $_SESSION['Rec'] = "register";
  482.                     //$errorMessage = "Registraties zijn uitgeschakelt";
  483.                 }else
  484.                 if($_SESSION['Rec'] == "submitregister")
  485.                 {
  486.                     if($_POST['reggoback'] == "Back")
  487.                     {
  488.                         $_SESSION['Rec'] = "login";
  489.                     }
  490.                     else
  491.                     {
  492.                         if (md5($_POST['norobot']) == $_SESSION['randomnr2'])
  493.                         {
  494.                             //echo(__LINE__ . "<BR />");
  495.                             $uname = $_POST['username'];
  496.                             $pword = $_POST['password'];
  497.                             $rpword = $_POST['rpassword'];
  498.                             if(email_valid($uname) == true)
  499.                             {
  500.                                 if($pword == $rpword)
  501.                                 {
  502.                                     if(strlen($pword) >= 6)
  503.                                     {
  504.                                         $uname = quote_smart($uname, $database['link']);
  505.                                         $SQL = "SELECT `Email` FROM `sms_accounts` WHERE `Email` = " . $uname;
  506.                                         $result = mysql_query($SQL,$database['link']);
  507.                                         $num_rows = @mysql_num_rows($result);
  508.                                         if ($num_rows == 0)
  509.                                         {
  510.                                             $pword = strtoupper(hash("whirlpool",$pword));
  511.                                             $SQL = "INSERT INTO `sms_accounts` (`Email`,`Password`) VALUES(".$uname.",'".$pword."')";
  512.                                             $result = mysql_query($SQL,$database['link']);
  513.                                             if($result)
  514.                                             {
  515.                                                 $_SESSION['Rec'] = "newaccount";
  516.                                                 mysql_query("INSERT INTO `sms_stats` VALUES(DATE_FORMAT(NOW(), '%Y-%m-01'),0,0,1,0) ON DUPLICATE KEY UPDATE NewUsers = NewUsers+1",$database['link']);
  517.                                             }
  518.                                             else
  519.                                             {
  520.                                                 $_SESSION['Rec'] = "register";
  521.                                                 $errorMessage = lng("catdb");
  522.                                             }
  523.                                         }
  524.                                         else
  525.                                         {
  526.                                             $_SESSION['Rec'] = "register";
  527.                                             $errorMessage = lng("aexists");
  528.                                         }
  529.                                     }
  530.                                     else
  531.                                     {
  532.                                         $_SESSION['Rec'] = "register";
  533.                                         $errorMessage = lng("pwhastobe");
  534.                                     }
  535.                                 }
  536.                                 else
  537.                                 {
  538.                                     $_SESSION['Rec'] = "register";
  539.                                     $errorMessage = lng("pwsnotsame");
  540.                                 }
  541.                             }
  542.                             else
  543.                             {
  544.                                 $_SESSION['Rec'] = "register";
  545.                                 $errorMessage = lng("wrongmail");
  546.                             }
  547.                         }
  548.                         else
  549.                         {
  550.                                 $_SESSION['Rec'] = "register";
  551.                                 $errorMessage = lng("robot");
  552.                         }
  553.                     }
  554.                     break;
  555.                 }
  556.             }
  557.             break;
  558.         }
  559.         case "UserIndex":
  560.         {
  561.         //echo(__LINE__ . "<BR />");
  562.             if((time()-$_SESSION['LoginTime']) <= 900)
  563.             {
  564.                 //echo(__LINE__ . "<BR />");
  565.                 $SQL = "SELECT credits FROM `sms_accounts` WHERE `id` = ".$_SESSION['index'];
  566.                 $result = mysql_query($SQL,$database['link']);
  567.                 $_SESSION['LoginTime'] = time();
  568.                 if ($result)
  569.                 {
  570.                     $num_rows = @mysql_num_rows($result);
  571.                     if ($num_rows > 0)
  572.                     {
  573.                         $row = mysql_fetch_array($result, MYSQL_ASSOC);
  574.                         //$_SESSION['login'] = "1";
  575.                         //$_SESSION['index'] = $row["id"];
  576.                         //$_SESSION['Email'] = $row["Email"];
  577.                         $_SESSION['credits'] = $row["credits"];
  578.                         //$_SESSION['CurrPage'] = "UserIndex";
  579.                         //$_SESSION['LoginTime'] = time();
  580.                     }
  581.                 }
  582.                 if ($_SERVER['REQUEST_METHOD'] == 'POST')
  583.                 {
  584.                     //echo(__LINE__ . "<BR />");
  585.                     switch($_SESSION['Rec'])
  586.                     {
  587.                         case "changepass":
  588.                         {
  589.                             $CurrPW = strtoupper(hash("whirlpool",$_POST['cpassword']));
  590.                             $NewPW =  strtoupper(hash("whirlpool",$_POST['npassword']));
  591.                             $RepPW =  strtoupper(hash("whirlpool",$_POST['rpassword']));
  592.                             if($NewPW != $RepPW)
  593.                             {
  594.                                 $errorMessage = lng("newpsmismatch");
  595.                                 $action = "newrepchpwfail";
  596.                             }
  597.                             else
  598.                             if(strlen($_POST['npassword']) < 6)
  599.                             {
  600.                                 $errorMessage = lng("pwhastobe");
  601.                                 $action = "newrepchpwfail";
  602.                             }
  603.                             else
  604.                             {
  605.                                 $SQL = "SELECT `Password` FROM `sms_accounts` WHERE `Email` = '".$_SESSION['Email']."'";
  606.                                 $result = mysql_query($SQL,$database['link']);
  607.                                 $num_rows = @mysql_num_rows($result);
  608.                                 if ($num_rows > 0)
  609.                                 {
  610.                                     $row = mysql_fetch_array($result, MYSQL_ASSOC);
  611.                                     $PlayerPW = $row["Password"];
  612.                                     if($PlayerPW != $CurrPW)
  613.                                     {
  614.                                         $errorMessage = lng("pwfail");
  615.                                         $action = "newrepchpwfail";
  616.                                     }
  617.                                     else
  618.                                     {
  619.                                         $SQL = "UPDATE `sms_accounts` set `Password` = '$NewPW' WHERE Email = '".$_SESSION['Email']."'";
  620.                                         mysql_query($SQL,$database['link']);
  621.                                         $action = "changepwsuccess";
  622.                                     }
  623.                                 }
  624.                                 else
  625.                                 {
  626.                                     $errorMessage = lng("uknerr");
  627.                                     $action = "newrepchpwfail";
  628.                                 }
  629.                             }
  630.                             break;
  631.                         }
  632.                         case "cemail":
  633.                         {
  634.                             $CurrPW = strtoupper(hash("whirlpool",$_POST['cpassword']));
  635.                             if(email_valid($_POST['nemail']) == true)
  636.                             {
  637.                                 $NewMail =  quote_smart($_POST['nemail'], $database['link']);
  638.                                 $SQL = "SELECT `Password` FROM `sms_accounts` WHERE `Email` = '".$_SESSION['Email']."'";
  639.                                 $result = mysql_query($SQL,$database['link']);
  640.                                 $num_rows = @mysql_num_rows($result);
  641.                                 if ($num_rows > 0)
  642.                                 {
  643.                                     $row = mysql_fetch_array($result, MYSQL_ASSOC);
  644.                                     $PlayerPW = $row["Password"];
  645.                                     if($PlayerPW != $CurrPW)
  646.                                     {
  647.                                         $errorMessage = lng("pwfail");
  648.                                         $action = "mailfail";
  649.                                     }
  650.                                     else
  651.                                     {
  652.                                         $SQL = "SELECT `Email` FROM `sms_accounts` WHERE `Email` = " . $NewMail;
  653.                                         $result = mysql_query($SQL,$database['link']);
  654.                                         $num_rows = @mysql_num_rows($result);
  655.                                         if ($num_rows == 0)
  656.                                         {
  657.                                             $SQL = "UPDATE `sms_accounts` set `Email` = $NewMail WHERE Email = '".$_SESSION['Email']."'";
  658.                                             $_SESSION['Email'] = $NewMail;
  659.                                             $result = mysql_query($SQL,$database['link']);
  660.                                             if($result)
  661.                                             {
  662.                                                 $action = "mailsucc";
  663.                                             }
  664.                                             else
  665.                                             {
  666.                                                 $action = "mailfail";
  667.                                                 $errorMessage = lng("ccmail");
  668.                                             }
  669.                                         }
  670.                                         else
  671.                                         {
  672.                                             $errorMessage = lng("mailused");
  673.                                             $action = "mailfail";
  674.                                         }
  675.                                     }
  676.                                 }
  677.                                 else
  678.                                 {
  679.                                     $errorMessage = lng("uknerr");
  680.                                     $action = "mailfail";
  681.                                 }
  682.                             }
  683.                             else
  684.                             {
  685.                                 $errorMessage = lng("wrongmail");
  686.                                 $action = "mailfail";
  687.                             }
  688.                             break;
  689.                         }
  690.                         case "sendsms":
  691.                         {
  692.                             if (md5($_POST['norobot']) == $_SESSION['randomnr2'])
  693.                             {
  694.                                 $cost = 5;
  695.                                 if($_SESSION['credits'] < $cost)
  696.                                 {
  697.                                     $errorMessage = lng("necredits");
  698.                                     $action = "sms";
  699.                                 }
  700.                                 else
  701.                                 {
  702.                                     if($_POST['sendertype'] == "OWNNR")
  703.                                     {
  704.                                         if($_POST['smsfrom'] != "MeetHelmond")
  705.                                         {
  706.                                             $cost += 3;
  707.                                         }
  708.                                     }
  709.                                     if($_SESSION['credits'] < $cost)
  710.                                     {
  711.                                         $errorMessage = lng("necredits");
  712.                                         $action = "sms";
  713.                                     }
  714.                                     else
  715.                                     {
  716.                                         if(is_numeric($_POST['smsfrom']) == false && strlen($_POST['smsfrom']) > 11)
  717.                                         {
  718.                                             $errorMessage = lng("fromwrong");
  719.                                             $action = "sms";
  720.                                         }
  721.                                         else
  722.                                         {
  723.                                             $passedtest = false;
  724.                                             if(substr ( $_POST['smsto'] , 0, 4 ) == "0031")
  725.                                             {
  726.                                                 $passedtest = true;
  727.                                             }
  728.                                             else
  729.                                             {
  730.                                                 if($_POST['international'] == "YES")
  731.                                                 {
  732.                                                     $cost += 3;
  733.                                                     if($_SESSION['credits'] < $cost)
  734.                                                     {
  735.                                                         $errorMessage = lng("necredits");
  736.                                                         $action = "sms";
  737.                                                     }
  738.                                                     else
  739.                                                     {
  740.                                                         $passedtest = true;
  741.                                                     }
  742.                                                 }
  743.                                                 else
  744.                                                 {
  745.                                                     $errorMessage = lng("interntnum");
  746.                                                     $action = "sms";
  747.                                                 }
  748.                                             }
  749.                                             if($passedtest == true)
  750.                                             {
  751.                                                 $passedtest = false;
  752.                                                 $USER_MSG_SEND = $_POST['message'];
  753.                                                 if(strlen($_POST['message']) > 140 || strlen($_POST['message']) == 0)
  754.                                                 {
  755.                                                     $errorMessage = lng("msglenght");
  756.                                                     $action = "sms";
  757.                                                 }
  758.                                                 else
  759.                                                 {
  760.                                                     if($_POST['adstype'] == "NO")
  761.                                                     {
  762.                                                         $cost += 10;
  763.                                                         if($_SESSION['credits'] < $cost)
  764.                                                         {
  765.                                                             $errorMessage = lng("necredits");
  766.                                                             $action = "sms";
  767.                                                         }
  768.                                                         else
  769.                                                         {
  770.                                                             $passedtest = true;
  771.                                                         }
  772.                                                     }
  773.                                                     else
  774.                                                     {
  775.                                                         $USER_MSG_SEND .= lng("admsg");
  776.                                                         $passedtest = true;
  777.                                                     }
  778.                                                 }
  779.                                                 if($passedtest == true)
  780.                                                 {
  781.                                                     if($_SESSION['credits'] < $cost)
  782.                                                     {
  783.                                                         $errorMessage = lng("necredits");
  784.                                                         $action = "sms";
  785.                                                     }
  786.                                                     else
  787.                                                     {
  788.                                                         if(is_numeric ( $_POST['smsto'] ) == false)
  789.                                                         {
  790.                                                             $errorMessage = lng("invreceip");
  791.                                                             $action = "sms";
  792.                                                         }
  793.                                                         else
  794.                                                         {
  795.                                                             $SMS = new CMSMS;
  796.                                                             $XMLtoSend = $SMS->CreateMessage(
  797.                                                                 'GET YOUR OWN SMS GATEWAY KEY',
  798.                                                                 $_POST['smsfrom'],
  799.                                                                 $_POST['smsto'],
  800.                                                                 0,
  801.                                                                 $USER_MSG_SEND
  802.                                                             );
  803.                                                             if(strlen($SMS->SendMessage('http://smssgateway.clubmessage.nl/cm/gateway.ashx',$XMLtoSend)) > 0)
  804.                                                             {
  805.                                                                 $errorMessage = lng("smsdelvfail");
  806.                                                                 $action = "sms";
  807.                                                             }
  808.                                                             else
  809.                                                             {
  810.                                                                 $_SESSION['credits'] -= $cost;
  811.                                                                 //echo($cost);
  812.                                                                 $SQL = "UPDATE `sms_accounts` set `credits` = '".$_SESSION['credits']."' WHERE id = '".$_SESSION['index']."'";
  813.                                                                 mysql_query($SQL,$database['link']);
  814.                                                                 mysql_query("INSERT INTO `sms_stats` VALUES(DATE_FORMAT(NOW(), '%Y-%m-01'),0,".$cost.",0,1) ON DUPLICATE KEY UPDATE SpentCredits = SpentCredits+".$cost.", SentSMS = SentSMS+1",$database['link']);
  815.                                                                 $action = "smssucc";
  816.                                                             }
  817.                                                         }
  818.                                                     }
  819.                                                 }
  820.                                             }
  821.                                         }
  822.                                     }
  823.                                 }
  824.                             }
  825.                             else
  826.                             {
  827.                                 $errorMessage = lng("robot");
  828.                                 $action = "sms";
  829.                             }
  830.                         }
  831.                     }
  832.                 }
  833.             }
  834.             break;
  835.         }
  836.     }
  837.     mysql_close($database['link']);
  838. //echo(__LINE__ . "<BR />");
  839.     switch($_SESSION['CurrPage'])
  840.     {
  841.         case "LoginIndex":
  842.         {
  843.             //echo(__LINE__ . "<BR />");
  844.             switch($_SESSION['Rec'])
  845.             {
  846.                 case "login":
  847.                 {
  848.                     //echo(__LINE__ . "<BR />");
  849.                     echo('
  850.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  851.                         <html xmlns="http://www.w3.org/1999/xhtml">
  852.                         <head>
  853.                         <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  854.                         <!--
  855.                         Gratis sms versturen naar nederland<BR />
  856.                         Gratis sms versturen over de hele wereld<BR />
  857.                         Free sms service in the netherlands<BR/>
  858.                         Gratis sms in nederland<BR />
  859.                         -->
  860.                     <title>'.lng("title").'</title>
  861.                         <link href="css.css" rel="stylesheet" type="text/css" />
  862.                         </head>
  863.                             <div class="information">
  864.                         ');
  865.                         if($errorMessage == "x")
  866.                         {
  867.                             echo('<div class="boxinfo">'.lng("smspanel").' <a href="mailto:sms@meet-helmond.nl">SMS@Meet-Helmond.nl</a> </div>');
  868.                         }
  869.                         else
  870.                         {
  871.                             echo('<div class="boxfail">'.$errorMessage.'</div>');
  872.                         }
  873.                         echo('
  874.                             <p>
  875.                             <form id="loginForm" name="loginForm" method="post" action="index.php">
  876.                               <table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  877.                                 <tr>
  878.                                   <td width="112"><b>'.lng("email").'</b></td>
  879.                                   <td width="188"><input name="username" type="text" class="textfield" id="username" /></td>
  880.                                 </tr>
  881.                                 <tr>
  882.                                   <td><b>'.lng("passwd").'</b></td>
  883.                                   <td><input name="password" type="password" class="textfield" id="password" /></td>
  884.                                 </tr>
  885.                                 <tr>
  886.                                 <td><b>'.lng("captchawr").'</b><br><img src="captcha.php" /></td>
  887.                                 <td><input name="norobot" class="textfield" type="text"></td>
  888.                                 </tr>
  889.                                 <tr>
  890.                                 <tr>
  891.                                     <td>&nbsp;</td>
  892.                                   <td><button type="submit" class="positive" id="loginaction" name="loginaction" value="Login">
  893.                                 <img src="images/icons/tick.png" alt=""/>
  894.                                 '.lng("login").'</button>
  895.                                 <button type="submit" class="positive" id="loginaction" name="loginaction" value="Register">
  896.                                 <img src="images/icons/info.png" alt=""/>
  897.                                 '.lng("register").'</button></td>
  898.                                 </tr>
  899.                               </table>
  900.                             </form>
  901.                             </div>
  902.                         <body>
  903.                         </body>
  904.                         </html>
  905.                     ');
  906.                     break;
  907.                 }
  908.                 case "register":
  909.                 {
  910.                     //echo(__LINE__ . "<BR />");
  911.                     $_SESSION['Rec'] = "submitregister";
  912.                     echo('
  913.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  914.                         <html xmlns="http://www.w3.org/1999/xhtml">
  915.                         <head>
  916.                         <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  917.                     <title>'.lng("title").'</title>
  918.                         <link href="css.css" rel="stylesheet" type="text/css" />
  919.                         </head>
  920.                             <div class="information">
  921.                         ');
  922.                         if($errorMessage == "x")
  923.                         {
  924.                             echo('<div class="boxinfo">'.lng("crhrya").'</div>');
  925.                         }
  926.                         else
  927.                         {
  928.                             echo('<div class="boxfail">'.$errorMessage.'</div>');
  929.                         }
  930.                         echo('
  931.                             <p>
  932.                             <form id="loginForm" name="loginForm" method="post" action="index.php">
  933.                               <table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  934.                                 <tr>
  935.                                   <td width="112"><b>'.lng("email").'</b></td>
  936.                                   <td width="188"><input name="username" type="text" class="textfield" id="username" /></td>
  937.                                 </tr>
  938.                                 <tr>
  939.                                   <td><b>'.lng("passwd").'</b></td>
  940.                                   <td><input name="password" type="password" class="textfield" id="password" /></td>
  941.                                 </tr>
  942.                                 <tr>
  943.                                 <tr>
  944.                                   <td><b>'.lng("reppswd").'</b></td>
  945.                                   <td><input name="rpassword" type="password" class="textfield" id="rpassword" /></td>
  946.                                 </tr>
  947.                                 <tr>
  948.                                 <td><b>'.lng("captchawr").'</b><br><img src="captcha.php" /></td>
  949.                                 <td><input name="norobot" class="textfield" type="text"></td>
  950.                                 </tr>
  951.                                 <tr>
  952.                                     <td>&nbsp;</td>
  953.                                   <td><button type="submit" class="positive" id="reggoback" name="reggoback" value="Register">
  954.                                 <img src="images/icons/tick.png" alt=""/>
  955.                                 '.lng("regnow").'</button>
  956.                                 <button type="submit" class="positive" id="reggoback" name="reggoback" value="Back">
  957.                                 <img src="images/icons/info.png" alt=""/>
  958.                                 '.lng("goback").'</button>
  959.                                 </td>
  960.                                 </tr>
  961.                               </table>
  962.                             </form>
  963.                             </div>
  964.                         <body>
  965.                         </body>
  966.                         </html>
  967.                     ');
  968.                     break;
  969.                 }
  970.                 case "newaccount":
  971.                 {
  972.                     //echo(__LINE__ . "<BR />");
  973.                     $_SESSION['Rec'] = "default";
  974.                     echo('
  975.                     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  976.                     <html xmlns="http://www.w3.org/1999/xhtml">
  977.                     <head>
  978.                     <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  979.                 <title>'.lng("title").'</title>
  980.                     <link href="css.css" rel="stylesheet" type="text/css" />
  981.                     </head>
  982.                         <div class="information">
  983.                         '.lng("acccsfly").'
  984.                         <p><a href="index.php"><strong><center>'.lng("homepage").'</center></strong></a>
  985.                         </div>
  986.                     <body>
  987.                     </body>
  988.                     </html>
  989.                     ');
  990.                     break;
  991.                 }
  992.                 default:
  993.                 {
  994.                     //echo(__LINE__ . "<BR />");
  995.                     echo('
  996.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  997.                         <html xmlns="http://www.w3.org/1999/xhtml">
  998.                         <head>
  999.                         <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1000.                     <title>'.lng("title").'</title>
  1001.                         <link href="css.css" rel="stylesheet" type="text/css" />
  1002.                         <!--
  1003.                         Gratis sms versturen naar nederland<BR />
  1004.                         Gratis sms versturen over de hele wereld<BR />
  1005.                         Free sms service in the netherlands<BR/>
  1006.                         Gratis sms in nederland<BR />
  1007.                         -->
  1008.                         </head>
  1009.                             <div class="information">
  1010.                         ');
  1011.                         if($errorMessage == "x")
  1012.                         {
  1013.                             echo('<div class="boxinfo">'.lng("smspanel").' <a href="mailto:sms@meet-helmond.nl">SMS@Meet-Helmond.nl</a></div>');
  1014.                         }
  1015.                         else
  1016.                         {
  1017.                             echo('<div class="boxfail">'.$errorMessage.'</div>');
  1018.                         }
  1019.                         echo('
  1020.                             <p>
  1021.                             <form id="loginForm" name="loginForm" method="post" action="index.php">
  1022.                               <table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  1023.                                 <tr>
  1024.                                   <td width="112"><b>'.lng("email").'</b></td>
  1025.                                   <td width="188"><input name="username" type="text" class="textfield" id="username" /></td>
  1026.                                 </tr>
  1027.                                 <tr>
  1028.                                   <td><b>'.lng("passwd").'</b></td>
  1029.                                   <td><input name="password" type="password" class="textfield" id="password" /></td>
  1030.                                 </tr>
  1031.                                 <tr>
  1032.                                 <td><b>'.lng("captchawr").'</b><br><img src="captcha.php" /></td>
  1033.                                 <td><input name="norobot" class="textfield" type="text"></td>
  1034.                                 </tr>
  1035.                                 <tr>
  1036.                                 <tr>
  1037.                                     <td>&nbsp;</td>
  1038.                                   <td><button type="submit" class="positive" id="loginaction" name="loginaction" value="Login">
  1039.                                 <img src="images/icons/tick.png" alt=""/>
  1040.                                 '.lng("login").'</button>
  1041.                                 <button type="submit" class="positive" id="loginaction" name="loginaction" value="Register">
  1042.                                 <img src="images/icons/info.png" alt=""/>
  1043.                                 '.lng("register").'</button></td>
  1044.                                 </tr>
  1045.                               </table>
  1046.                             </form>
  1047.                             </div>
  1048.                         <body>
  1049.                         </body>
  1050.                         </html>
  1051.                     ');
  1052.                     break;
  1053.                 }
  1054.             }
  1055.             break;
  1056.         }
  1057.         case "UserIndex":
  1058.         {
  1059.             //echo(__LINE__ . "<BR />");
  1060.             if((time()-$_SESSION['LoginTime']) > 900)
  1061.             {
  1062.                 echo('
  1063.                     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1064.                     <html xmlns="http://www.w3.org/1999/xhtml">
  1065.                     <head>
  1066.                     <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1067.                 <title>'.lng("title").'</title>
  1068.                     <link href="css.css" rel="stylesheet" type="text/css" />
  1069.                     </head>
  1070.                         <div class="information">
  1071.                     ');
  1072.                     echo('<div class="boxfail">'.lng("timeouts").'</div>');
  1073.                     echo('
  1074.                         <p>
  1075.                         <form id="loginForm" name="loginForm" method="post" action="index.php">
  1076.                           <table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  1077.                             <tr>
  1078.                               <td width="112"><b>'.lng("email").'</b></td>
  1079.                               <td width="188"><input name="username" type="text" class="textfield" id="username" /></td>
  1080.                             </tr>
  1081.                             <tr>
  1082.                               <td><b>'.lng("passwd").'</b></td>
  1083.                               <td><input name="password" type="password" class="textfield" id="password" /></td>
  1084.                             </tr>
  1085.                             <tr>
  1086.                             <td><b>'.lng("captchawr").'</b><br><img src="captcha.php" /></td>
  1087.                             <td><input name="norobot" class="textfield" type="text"></td>
  1088.                             </tr>
  1089.                             <tr>
  1090.                             <tr>
  1091.                                 <td>&nbsp;</td>
  1092.                               <td><button type="submit" class="positive" id="loginaction" name="loginaction" value="Login">
  1093.                             <img src="images/icons/tick.png" alt=""/>
  1094.                             '.lng("login").'</button>
  1095.                             <button type="submit" class="positive" id="loginaction" name="loginaction" value="Register">
  1096.                             <img src="images/icons/info.png" alt=""/>
  1097.                             '.lng("register").'</button></td>
  1098.                             </tr>
  1099.                           </table>
  1100.                         </form>
  1101.                         </div>
  1102.                     <body>
  1103.                     </body>
  1104.                     </html>
  1105.                 ');
  1106.                 $templang = $_SESSION['lang'];
  1107.                 session_destroy();
  1108.                 session_start();
  1109. $_SESSION['lang'] = $templang;
  1110.                 exit();
  1111.             }
  1112.             switch($action)
  1113.             {
  1114.                 case "logout":
  1115.                 {
  1116.                     $_SESSION['Rec'] = "logout";
  1117.                     echo('
  1118.                     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1119.                     <html xmlns="http://www.w3.org/1999/xhtml">
  1120.                     <head>
  1121.                     <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1122.                 <title>'.lng("title").'</title>
  1123.                     <link href="css.css" rel="stylesheet" type="text/css" />
  1124.                     </head>
  1125.                         <div class="information">
  1126.                         '.lng("loggedout").'
  1127.                         <p><a href="index.php"><strong><center>'.lng("homepage").'</center></strong></a>
  1128.                         </div>
  1129.                     <body>
  1130.                     </body>
  1131.                     </html>
  1132.                     ');
  1133.                     session_destroy();
  1134.                     break;
  1135.                 }
  1136.                 case "changepwsuccess":
  1137.                 {
  1138.                     $_SESSION['Rec'] = "default";
  1139.                     echo('
  1140.                     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1141.                     <html xmlns="http://www.w3.org/1999/xhtml">
  1142.                     <head>
  1143.                     <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1144.                 <title>'.lng("title").'</title>
  1145.                     <link href="css.css" rel="stylesheet" type="text/css" />
  1146.                     </head>
  1147.                         <div class="information">
  1148.                         '.lng("pwchsuccsfly").'
  1149.                         <p><a href="index.php"><strong><center>'.lng("homepage").'</center></strong></a>
  1150.                         </div>
  1151.                     <body>
  1152.                     </body>
  1153.                     </html>
  1154.                     ');
  1155.                     break;
  1156.                 }
  1157.                 case "mailsucc":
  1158.                 {
  1159.                     $_SESSION['Rec'] = "default";
  1160.                     echo('
  1161.                     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1162.                     <html xmlns="http://www.w3.org/1999/xhtml">
  1163.                     <head>
  1164.                     <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1165.                 <title>'.lng("title").'</title>
  1166.                     <link href="css.css" rel="stylesheet" type="text/css" />
  1167.                     </head>
  1168.                         <div class="information">
  1169.                         '.lng("elsuccchd").'
  1170.                         <p><a href="index.php"><strong><center>'.lng("homepage").'</center></strong></a>
  1171.                         </div>
  1172.                     <body>
  1173.                     </body>
  1174.                     </html>
  1175.                     ');
  1176.                     session_destroy();
  1177.                     break;
  1178.                 }
  1179.                 case "newrepchpwfail":
  1180.                 {
  1181.                     $_SESSION['Rec'] = "changepass";
  1182.                     echo('
  1183.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1184.                         <html xmlns="http://www.w3.org/1999/xhtml">
  1185.                         <head>
  1186.                         <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1187.                     <title>'.lng("title").'</title>
  1188.                         <link href="css.css" rel="stylesheet" type="text/css" />
  1189.                         </head>
  1190.                             <div class="information">
  1191.                         <div class="boxfail">'.lng("flwersocrd").'<BR/>');echo($errorMessage);echo('</div>
  1192.                             <p>
  1193.                             <form id="passForm" name="passForm" method="post" action="index.php">
  1194.                               <table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  1195.                                 <tr>
  1196.                                   <td><b>'.lng("currpw").'</b></td>
  1197.                                   <td><input name="cpassword" type="password" class="textfield" id="cpassword" /></td>
  1198.                                 </tr>
  1199.                                 <tr>
  1200.                                 <tr>
  1201.                                   <td><b>'.lng("newpw").'</b></td>
  1202.                                   <td><input name="npassword" type="password" class="textfield" id="npassword" /></td>
  1203.                                 </tr>
  1204.                                 <tr>
  1205.                                 <tr>
  1206.                                   <td><b>'.lng("repnewpw").'</b></td>
  1207.                                   <td><input name="rpassword" type="password" class="textfield" id="rpassword" /></td>
  1208.                                 </tr>
  1209.                                 <tr>
  1210.                                     <td>&nbsp;</td>
  1211.                                   <td><button type="submit" class="positive" value="Change">
  1212.                                 <img src="images/icons/tick.png" alt=""/>
  1213.                                 '.lng("change").'</button></td>
  1214.                                 </tr>
  1215.                               </table>
  1216.                             </form>
  1217.                             <div class="buttons">
  1218.                             <a href="index.php" class="negative">
  1219.                                 <img src="images/icons/home.png" alt="Go Back"/>
  1220.                                 '.lng("goback").'
  1221.                             </a>
  1222.                             </div>
  1223.                         </div>
  1224.                             </div>
  1225.                         <body>
  1226.                         </body>
  1227.                         </html>
  1228.                     ');
  1229.                     break;
  1230.                 }
  1231.                 case "changepassword":
  1232.                 {
  1233.                     $_SESSION['Rec'] = "changepass";
  1234.                     echo('
  1235.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1236.                         <html xmlns="http://www.w3.org/1999/xhtml">
  1237.                         <head>
  1238.                         <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1239.                     <title>'.lng("title").'</title>
  1240.                         <link href="css.css" rel="stylesheet" type="text/css" />
  1241.                         </head>
  1242.                             <div class="information">
  1243.                         <div class="boxinfo">'.lng("hrycnchypw").'</div>
  1244.                             <p>
  1245.                             <form id="passForm" name="passForm" method="post" action="index.php">
  1246.                               <table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  1247.                                 <tr>
  1248.                                   <td><b>'.lng("currpw").'</b></td>
  1249.                                   <td><input name="cpassword" type="password" class="textfield" id="cpassword" /></td>
  1250.                                 </tr>
  1251.                                 <tr>
  1252.                                 <tr>
  1253.                                   <td><b>'.lng("newpw").'</b></td>
  1254.                                   <td><input name="npassword" type="password" class="textfield" id="npassword" /></td>
  1255.                                 </tr>
  1256.                                 <tr>
  1257.                                 <tr>
  1258.                                   <td><b>'.lng("repnewpw").'</b></td>
  1259.                                   <td><input name="rpassword" type="password" class="textfield" id="rpassword" /></td>
  1260.                                 </tr>
  1261.                                 <tr>
  1262.                                     <td>&nbsp;</td>
  1263.                                   <td><button type="submit" class="positive" value="Change">
  1264.                                 <img src="images/icons/tick.png" alt=""/>
  1265.                                 '.lng("change").'</button></td>
  1266.                                 <td>
  1267.                               </table>
  1268.                             </form>
  1269.                             <div class="buttons">
  1270.                             <a href="index.php" class="negative">
  1271.                                 <img src="images/icons/home.png" alt="Go Back"/>
  1272.                                 '.lng("goback").'
  1273.                             </a>
  1274.                             </div>
  1275.                             </div>
  1276.                         <body>
  1277.                         </body>
  1278.                         </html>
  1279.                     ');
  1280.                     break;
  1281.                 }
  1282.                 case "mailfail":
  1283.                 {
  1284.                     $_SESSION['Rec'] = "cemail";
  1285.                     echo('
  1286.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1287.                         <html xmlns="http://www.w3.org/1999/xhtml">
  1288.                         <head>
  1289.                         <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1290.                     <title>'.lng("title").'</title>
  1291.                         <link href="css.css" rel="stylesheet" type="text/css" />
  1292.                         </head>
  1293.                             <div class="information">
  1294.                         <div class="boxfail">');echo($errorMessage);echo('</div>
  1295.                             <p>
  1296.                             <form id="mailForm" name="mailForm" method="post" action="index.php">
  1297.                               <table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  1298.                                 <tr>
  1299.                                   <td><b>'.lng("currpw").'</b></td>
  1300.                                   <td><input name="cpassword" type="password" class="textfield" id="cpassword" /></td>
  1301.                                 </tr>
  1302.                                 <tr>
  1303.                                   <td><b>'.lng("ynewmail").'</b></td>
  1304.                                   <td><input name="nemail" type="text" class="textfield" id="nemail" /></td>
  1305.                                 </tr>
  1306.                                     <td>&nbsp;</td>
  1307.                                   <td><button type="submit" class="positive" value="Verander">
  1308.                                 <img src="images/icons/tick.png" alt=""/>
  1309.                                 '.lng("change").'</button></td>
  1310.                                 <td>
  1311.                               </table>
  1312.                             </form>
  1313.                             <div class="buttons">
  1314.                             <a href="index.php" class="negative">
  1315.                                 <img src="images/icons/home.png" alt="Go Back"/>
  1316.                                 '.lng("goback").'
  1317.                             </a>
  1318.                             </div>
  1319.                             </div>
  1320.                         <body>
  1321.                         </body>
  1322.                         </html>
  1323.                     ');
  1324.                     break;
  1325.                 }
  1326.                 case "linkemail":
  1327.                 {
  1328.                     $_SESSION['Rec'] = "cemail";
  1329.                     echo('
  1330.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1331.                         <html xmlns="http://www.w3.org/1999/xhtml">
  1332.                         <head>
  1333.                         <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1334.                     <title>'.lng("title").'</title>
  1335.                         <link href="css.css" rel="stylesheet" type="text/css" />
  1336.                         </head>
  1337.                             <div class="information">
  1338.                         <div class="boxinfo">'.lng("hrycnchyremail").'</div>
  1339.                             <p>
  1340.                             <form id="mailForm" name="mailForm" method="post" action="index.php">
  1341.                               <table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
  1342.                                 <tr>
  1343.                                   <td><b>'.lng("currpw").'</b></td>
  1344.                                   <td><input name="cpassword" type="password" class="textfield" id="cpassword" /></td>
  1345.                                 </tr>
  1346.                                 <tr>
  1347.                                 <tr>
  1348.                                   <td><b>'.lng("ynewmail").'</b></td>
  1349.                                   <td><input name="nemail" type="text" class="textfield" id="nemail" /></td>
  1350.                                 </tr>
  1351.                                     <td>&nbsp;</td>
  1352.                                   <td><button type="submit" class="positive" value="Verander">
  1353.                                 <img src="images/icons/tick.png" alt=""/>
  1354.                                 '.lng("change").'</button></td>
  1355.                                 <td>
  1356.                               </table>
  1357.                             </form>
  1358.                             <div class="buttons">
  1359.                             <a href="index.php" class="negative">
  1360.                                 <img src="images/icons/home.png" alt="Go Back"/>
  1361.                                 '.lng("goback").'
  1362.                             </a>
  1363.                             </div>
  1364.                             </div>
  1365.                         <body>
  1366.                         </body>
  1367.                         </html>
  1368.                     ');
  1369.                     break;
  1370.                 }
  1371.                 case "sms":
  1372.                 {
  1373.                     //echo(__LINE__ . "<BR />");
  1374.                     $_SESSION['Rec'] = "sendsms";
  1375.                     echo('
  1376.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1377.                         <html xmlns="http://www.w3.org/1999/xhtml">
  1378.                         <head>
  1379.                         <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1380.                     <title>'.lng("title").'</title>
  1381.                         <link href="css.css" rel="stylesheet" type="text/css" />
  1382.                         <script language="javascript" type="text/javascript">
  1383.                         function limitText(limitField, limitCount, limitNum) {
  1384.                             if (limitField.value.length > limitNum) {
  1385.                                 limitField.value = limitField.value.substring(0, limitNum);
  1386.                             } else {
  1387.                                 limitCount.value = limitNum - limitField.value.length;
  1388.                             }
  1389.                         }
  1390.                         </script>
  1391.                         </head>
  1392.                             <div class="information">
  1393.                         ');
  1394.                     if($errorMessage == "x")
  1395.                     {
  1396.                         echo('<div class="boxinfo">'.lng("sndsmsinf").'</div>
  1397.                             <p>
  1398.                             <form id="loginForm" name="loginForm" method="post" action="index.php">
  1399.                                 <table width="800" border="0" align="center" cellpadding="2" cellspacing="0">
  1400.                                 <tr>
  1401.                                     <td width="320"><b>'.lng("fromwho").'</b></td>
  1402.                                     <td>
  1403.                                         <input type="radio" name="sendertype" value="USEMH" checked>'.lng("deffrm").'<br>
  1404.                                         <input type="radio" name="sendertype" value="OWNNR" >'.lng("wantownnum").'<br>
  1405.                                     </td>
  1406.                                 </tr>
  1407.                                 <tr>
  1408.                                     <td width="320"><b>'.lng("interntsmsquest").'</b></td>
  1409.                                     <td>
  1410.                                         <input type="radio" name="international" value="NO" checked>'.lng("ans_no").'<br>
  1411.                                         <input type="radio" name="international" value="YES" >'.lng("ans_yes").'<br>
  1412.                                     </td>
  1413.                                 </tr>
  1414.                                 <tr>
  1415.                                     <td width="320"><b>'.lng("enabledadsz").'</b></td>
  1416.                                     <td>
  1417.                                         <input type="radio" name="adstype" value="YES" checked>'.lng("ans_yes2").'<br>
  1418.                                         <input type="radio" name="adstype" value="NO">'.lng("ans_no2").'<br>
  1419.                                     </td>
  1420.                                 </tr>
  1421.                                 <tr>
  1422.                                     <td width="320"><b>'.lng("wordfrom").'</b></td>
  1423.                                     <td width><input name="smsfrom" type="text" class="textfield" id="smsfrom" value="MeetHelmond"/></td>
  1424.                                 </tr>
  1425.                                 <tr>
  1426.                                     <td width="320"><b>'.lng("senditto").'</b></td>
  1427.                                     <td width><input name="smsto" type="text" class="textfield" id="smsto" value="0031600000000"/></td>
  1428.                                 </tr>
  1429.                                 <tr>
  1430.                                     <td width="320"><b>'.lng("msgtext").'</b></td>
  1431.                                     <td width><textarea name="message" type="text" class="textfield" id="message" rows="10" onKeyDown="limitText(this.form.message,this.form.countdown,140);" onKeyUp="limitText(this.form.message,this.form.countdown,140);"></textarea>
  1432.                                     <BR /><font size="1">'.lng("maxchars").'<br/>
  1433.                                     '.lng("leftchrs").' <input readonly type="text" name="countdown" size="3" value="140"></font>
  1434.                                     </td>
  1435.                                 </tr>
  1436.                                 <tr>
  1437.                                 <td><b>'.lng("captchawr").'</b><br><img src="captcha.php" /></td>
  1438.                                 <td><input name="norobot" class="textfield" type="text"></td>
  1439.                                 </tr>
  1440.                                 <tr>
  1441.                                     <td>&nbsp;</td>
  1442.                                   <td><button type="submit" class="positive" value="Send">
  1443.                                 <img src="images/icons/tick.png" alt=""/>
  1444.                                 '.lng("senditt").'</button></td>
  1445.                                 </tr>
  1446.                               </table>
  1447.                             </form>
  1448.                             <div class="buttons">
  1449.                             <a href="index.php" class="negative">
  1450.                                 <img src="images/icons/home.png" alt="Go Back"/>
  1451.                                 '.lng("goback").'
  1452.                             </a>
  1453.                             </div>
  1454.                             </div>
  1455.                         <body>
  1456.                         </body>
  1457.                         </html>
  1458.                         ');
  1459.                     }
  1460.                     else
  1461.                     {
  1462.                         echo('<div class="boxfail">'.$errorMessage.'</div><p>
  1463.                             <form id="loginForm" name="loginForm" method="post" action="index.php">
  1464.                               <table width="800" border="0" align="center" cellpadding="2" cellspacing="0">
  1465.                                 <tr>
  1466.                                     <td width="320"><b>'.lng("fromwho").'</b></td>
  1467.                                     <td>
  1468.                                         <input type="radio" name="sendertype" value="USEMH" checked>'.lng("deffrm").'<br>
  1469.                                         <input type="radio" name="sendertype" value="OWNNR" >'.lng("wantownnum").'<br>
  1470.                                     </td>
  1471.                                 </tr>
  1472.                                 <tr>
  1473.                                     <td width="320"><b>'.lng("interntsmsquest").'</b></td>
  1474.                                     <td>
  1475.                                         <input type="radio" name="international" value="NO" checked>'.lng("ans_no").'<br>
  1476.                                         <input type="radio" name="international" value="YES" >'.lng("ans_yes").'<br>
  1477.                                     </td>
  1478.                                 </tr>
  1479.                                 <tr>
  1480.                                     <td width="320"><b>'.lng("enabledadsz").'</b></td>
  1481.                                     <td>
  1482.                                         <input type="radio" name="adstype" value="YES" checked>'.lng("ans_yes2").'<br>
  1483.                                         <input type="radio" name="adstype" value="NO">'.lng("ans_no2").'<br>
  1484.                                     </td>
  1485.                                 </tr>
  1486.                                 <tr>
  1487.                                     <td width="320"><b>'.lng("wordfrom").'</b></td>
  1488.                                     <td width><input name="smsfrom" type="text" class="textfield" id="smsfrom" value="');
  1489.                                     print $_POST['smsfrom'];
  1490.                                     echo('"/></td>
  1491.                                 </tr>
  1492.                                 <tr>
  1493.                                     <td width="320"><b'.lng("senditto").'</b></td>
  1494.                                     <td width><input name="smsto" type="text" class="textfield" id="smsto" value="');
  1495.                                     print $_POST['smsto'];
  1496.                                     echo('"/></td>
  1497.                                 </tr>
  1498.                                 <tr>
  1499.                                     <td width="320"><b>'.lng("msgtext").'</b></td>
  1500.                                     <td width><textarea name="message" type="text" class="textfield" id="message" rows="10" onKeyDown="limitText(this.form.message,this.form.countdown,140);" onKeyUp="limitText(this.form.message,this.form.countdown,140);" value="');
  1501.                                     print $_POST['message'];
  1502.                                     echo('"></textarea>
  1503.                                     <BR /><font size="1">'.lng("maxchars").'<br/>
  1504.                                     '.lng("leftchrs").' <input readonly type="text" name="countdown" size="3" value="140"> </font>
  1505.                                     </td>
  1506.                                 </tr>
  1507.                                 <tr>
  1508.                                     <td><b>'.lng("captchawr").'</b><br><img src="captcha.php" /></td>
  1509.                                     <td><input name="norobot" class="textfield" type="text"></td>
  1510.                                 </tr>
  1511.                                 <tr>
  1512.                                     <td>&nbsp;</td>
  1513.                                     <td><button type="submit" class="positive" value="Verstuur">
  1514.                                         <img src="images/icons/tick.png" alt="Verstuur"/>
  1515.                                         '.lng("senditt").'</button>
  1516.                                     </td>
  1517.                                 </tr>
  1518.                               </table>
  1519.                             </form>
  1520.                             <div class="buttons">
  1521.                             <a href="index.php" class="negative">
  1522.                                 <img src="images/icons/home.png" alt="Go Back"/>
  1523.                                 '.lng("goback").'
  1524.                             </a>
  1525.                             </div>
  1526.                             </div>
  1527.                         <body>
  1528.                         </body>
  1529.                         </html>
  1530.                     ');
  1531.                     }
  1532.                     break;
  1533.                 }
  1534.                 case "smssucc":
  1535.                 {
  1536.                     $_SESSION['Rec'] = "default";
  1537.                     echo('
  1538.                     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1539.                     <html xmlns="http://www.w3.org/1999/xhtml">
  1540.                     <head>
  1541.                     <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1542.                 <title>'.lng("title").'</title>
  1543.                     <link href="css.css" rel="stylesheet" type="text/css" />
  1544.                     </head>
  1545.                         <div class="information">
  1546.                         '.lng("smsetnsuccfsly").'
  1547.                         <p><a href="index.php"><strong><center>'.lng("homepage").'</center></strong></a>
  1548.                         </div>
  1549.                     <body>
  1550.                     </body>
  1551.                     </html>
  1552.                     ');
  1553.                     break;
  1554.                 }
  1555.                 default:
  1556.                 {
  1557.                     $_SESSION['Rec'] = "default";
  1558.                     echo('
  1559.                     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  1560.                     <html xmlns="http://www.w3.org/1999/xhtml">
  1561.                     <head>
  1562.                     <meta http-equiv="Content-Type" content="text/html; charset='.lng("charset").'" />
  1563.                 <title>'.lng("title").'</title>
  1564.                     <link href="css.css" rel="stylesheet" type="text/css" />
  1565.                     </head>
  1566.                         <div class="information">
  1567.                         <center><div class="box1">'.lng("welcome").' ');
  1568.                         print $_SESSION['Email'];
  1569.                         echo('<BR/>'.lng("crdits").' ');
  1570.                         print $_SESSION['credits'];
  1571.                         echo('<BR /><BR />'.lng("welcomehelp").' <a href="mailto:sms@meet-helmond.nl">SMS@Meet-Helmond.nl</a><p>
  1572.                         </div></center>
  1573.                         <p>
  1574.                         <center><table width="750">
  1575.                         <tr><td align="center"><a href="index.php?action=changepassword"><img src="images/password.png"/></a></td>
  1576.                             <td align="center"><a href="index.php?action=linkemail"><img src="images/linkemail.png"/></a></td>
  1577.                             </tr>
  1578.                         <tr><td align="center"><a href="index.php?action=changepassword">'.lng("changeherepw").'</a></td>
  1579.                             <td align="center"><a href="index.php?action=linkemail">'.lng("changehereeml").'</a></td>
  1580.                             </tr>
  1581.                         <tr><td align="center"><a href="https://www.adworkmedia.com/checkout/index.php?pubID=8791&CID=2196&SID='.$_SESSION['Email'].'"><img src="images/earn.png"/></a></td>
  1582.                             <td align="center"><a href="https://www.adworkmedia.com/checkout/index.php?pubID=8791&CID=2202&SID='.$_SESSION['Email'].'"><img src="images/earn.png"/></a></td>
  1583.                             <td align="center"><a href="https://www.adworkmedia.com/checkout/index.php?pubID=8791&CID=2203&SID='.$_SESSION['Email'].'"><img src="images/earn.png"/></a></td></tr>
  1584.                         <tr>                            <td align="center"><a href="https://www.adworkmedia.com/checkout/index.php?pubID=8791&CID=2196&SID='.$_SESSION['Email'].'">'.lng("earncrdts").' (+2)</a></td>
  1585.                             <td align="center"><a href="https://www.adworkmedia.com/checkout/index.php?pubID=8791&CID=2202&SID='.$_SESSION['Email'].'">'.lng("earncrdts").' (+5)</a></td>
  1586.                             <td align="center"><a href="https://www.adworkmedia.com/checkout/index.php?pubID=8791&CID=2203&SID='.$_SESSION['Email'].'">'.lng("earncrdts").' (+10)</a></td>
  1587. </tr>
  1588.                         <tr><td align="center"><a href="index.php?action=sms"><img src="images/sms.png"/></a></td></tr>
  1589.                         <tr><td align="center"><a href="index.php?action=sms">'.lng("sendnewsmsnow").'</a></td></tr>
  1590.                         <p>
  1591.                         </table></center>
  1592.                         <p><div class="buttons">
  1593.                             <a href="index.php?action=logout" class="negative">
  1594.                                 <img src="images/icons/error.png" alt="Logout"/>
  1595.                                 '.lng("logoutnow").'
  1596.                             </a>
  1597.                         </div>
  1598.                         </div>
  1599.                     <body>
  1600.                     </body>
  1601.                     </html>
  1602.                     ');
  1603.                     break;
  1604.                 }
  1605.             }
  1606.         }
  1607.     }
  1608.     class CMSMS
  1609.     {
  1610.         function CreateMessage($ProductToken, $Sender, $Recipient, $Tariff, $Body)
  1611.         {
  1612.             $XMLSMS = new SimpleXMLElement('<MESSAGES/>');
  1613.             $XMLSMS->addChild('AUTHENTICATION');
  1614.             $XMLSMS->AUTHENTICATION->addChild('PRODUCTTOKEN', $ProductToken);
  1615.             $XMLSMS->addChild('TARIFF'); $XMLSMS->TARIFF = $Tariff;
  1616.             $XMLSMS->addChild('MSG');
  1617.             $XMLSMS->MSG->addChild('FROM');
  1618.             $XMLSMS->MSG->FROM = $Sender;
  1619.             $XMLSMS->MSG->addChild('BODY');
  1620.             $XMLSMS->MSG->BODY = $Body;
  1621.             $XMLSMS->MSG->addChild('TO');
  1622.             $XMLSMS->MSG->TO = $Recipient;
  1623.             return $XMLSMS->asXML();
  1624.         }
  1625.         function SendMessage($URL, $Message)
  1626.         {
  1627.             $ch = curl_init();
  1628.             curl_setopt($ch, CURLOPT_URL, $URL);
  1629.             curl_setopt($ch, CURLOPT_POST, 1);
  1630.             curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml', 'Content-length: ' . strlen($Message)));
  1631.             curl_setopt($ch, CURLOPT_POSTFIELDS, $Message);
  1632.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  1633.             $return = curl_exec($ch);
  1634.             $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  1635.             curl_close($ch);
  1636.             if($http_status == 200)
  1637.             {
  1638.                 return $return;
  1639.             }else
  1640.             {
  1641.                 return $http_status;
  1642.             }
  1643.         }
  1644.     }
  1645. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement