help in sms gateway - php.api

Discussion in 'PHP' started by spyman2020, Aug 11, 2008.

  1. #1
    spyman2020, Aug 11, 2008 IP
  2. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #2
    it is so easy

    #get balance
    $data = @implode("",@file("http://www.domain.com/sendsms/checklogin.asp?user=******&pass=****"));

    now $data contains what page returns.

    regards
     
    Vooler, Aug 11, 2008 IP
  3. Property_Control

    Property_Control Peon

    Messages:
    18
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You know you can just send text messages as emails, i have the script i made for it from my site before i overhauled it
    here:
     
    Property_Control, Aug 11, 2008 IP
    Vooler likes this.
  4. spyman2020

    spyman2020 Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thanks vooler

    actually i don't get error in get balance

    but the problem in sending SMS it says Error Connecting to Gateway even i know the URL is correct

    i use this cod

    function SendSms($UserName,$UserPassword,$Numbers,$Originator,$Message){
    $url = "http://www.domain.com/sendsms/sendsms.asp?username=".$UserName."&password=".$UserPassword."&mno=".$Numbers."&msg=".$Message."&Sid=".$Originator."&fl=".$flash.";
    if (!(@$fp =fopen($url,"r"))){
    return "Erorr Connecting to Gateway.";
    }else{
    @$FainalResult =@fread(@$fp, 10);
    @fclose(@$fp);
    @$FainalResult=(integer)str_replace(" ","",@$FainalResult);

    whats wrong here ?????is there another way to get the url..
    by the way when i use the url in browser its working



    thanks Property_Control

    i really don't need sms to email as

    I have the sms gateway just need to make correct api



    thanks
     
    spyman2020, Aug 12, 2008 IP
  5. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #5
    Check with your hosting servic, they might not have fsockopen not working. And if the api you are using might be using fopen and you php not configured to read from urls.

    regards
     
    Vooler, Aug 12, 2008 IP