goText Forums

International Forums => Developers and translators help => Topic started by: vampiroh on January 21, 2010, 06:45:08 pm

Title: help me with this code
Post by: vampiroh on January 21, 2010, 06:45:08 pm
Code: [Select]
<?php
/*
================
Mr-Palui 2008
================
Jangan Lupa Creditnya yah
heheheh....!!1
*/

function SendSms($from$to$text)
{
        
    
$serverRequest "http://www.smsglobal.com.au/http-api.php?action=sendsms";    
    
$serverRequest "&user="keanpogi;////i am getting error he
    
$serverRequest "&password="blahblah;////i am getting error here please fix
    
$serverRequest .= "&from=".$from;
    
$serverRequest .= "&to=".$to;
    
$serverRequest .= "&text=".urlencode($text);
    
    
$serverResult file_get_contents($serverRequest);
    
    if (!
$serverResult)
         return 
"Returned error while trying to connect to smsclist";

    
$xml simplexml_load_string($serverResult);
    
    if (
$xml->success == "true")
        
$result $xml->msgid;
    else
        
$result $xml->errormsg;

    return 
$result;
}
?>



 
Code: [Select]
$serverRequest = "&user="keanpogi;////i am getting error he
    $serverRequest = "&password="blahblah;////i am getting error here please fix
Title: Re: help me with this code
Post by: egosum on January 24, 2010, 09:57:16 pm
Some points are missing:

$serverRequest .= "&user=".keanpogi;
$serverRequest .= "&password=."blahblah;


Hope this will help.

Hint: You should use the Gotext Browser class to perform safe (stable) get and post request.

Good luck!