Username: Password:

Author Topic: help me with this code  (Read 3646 times)

vampiroh

  • Newbie
  • *
  • Posts: 3
    • View Profile
help me with this code
« 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

egosum

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: help me with this code
« Reply #1 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!