Jump to content

angelcause

Members
  • Posts

    8
  • Joined

  • Last visited

Posts posted by angelcause

  1. Actually I have a script which runs in two modes - Local Host and WAN. The IP I am using is like 203.135.37.204

     

    Here is what I want 

     

    I have 2 scripts 

     

    Script A

    and 

    Script B

     

    Now I want the script to see if the public address of client is  the above (203.135.37.204) then it should run script A else it should run script B

  2. Hello, 

                Below is my code I am using from a Gateway for sending SMS.

     

    I have 2 felds    Dst_nbr and Message, Now the problem is that how can I get values from fields (Dst_nbr and Message) into the values of <Dst_nbr> and <Message> of the code which you can see below.

     

    Currently you can see that the Destination Number code value is 923665487745  and Message is "A task is due, Please check your email or Login into the Dashboard.". 

     

    I want it to get the values from the fields of Dst_nbr and Message, So that it can change accordingly to the data entered or available in the fields. 

     

     

     

    <?php
    set_time_limit(0);
    //URL to call
    $post_data='<?xml version="1.0" encoding="utf-8"?>
    <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
     <soap12:Body>
    <SendSMS xmlns="http://tempuri.org/">
    <Src_nbr>923189377654</Src_nbr>
     <Password>mikeishere</Password>
     <Dst_nbr>923665487745</Dst_nbr>
     <Mask>STAFF</Mask>
     <Message>"A task is due, Please check your email or Login into the Dashboard."</Message>
     <TransactionID>'.rand().'</TransactionID>
    </SendSMS>
     </soap12:Body>
    </soap12:Envelope>';
     
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,            ZONG_DOMAIN_URL );
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt($ch, CURLOPT_POST,           1 );
    curl_setopt($ch, CURLOPT_POSTFIELDS,     $post_data ); 
    curl_setopt($ch, CURLOPT_HTTPHEADER,     array('Content-Type: application/soap+xml', 'charset=utf-8')); 
       echo $result = curl_exec ($ch);
     

    ?>  

  3. And that "/sms.php" part doesn't show up anywhere in the code you posted.

     

    I'm pretty sure that "URL address blocked" message wasn't generated by our forum.

    Yes it is not in the code, thats why I wanted to know how can it be added with the values.

  4. Hi

    You can use $_GET['name'] to get the value associated to 'name' from Url.

    Example:

    $post_data = '... <Message>'. $_GET['Name'] .'-'. $_GET[Age'] .'</Message> ...';

    Sorry MarPlo, 

                            Can you please tell me where to paste this code, can you please add it in the above actual code.

  5. I am using some PHP API script to send a text message and in the <message> tags I want to get 2 values from the url (e.g. (URL address blocked: See forum rules)/sms.php?Name=John&Age=28). Problem is this that in between the php script there is a script of SOAP (I think). 
     
    Sorry I am not good at programming.
     
     
    <?php
    set_time_limit(0);
    //URL to call
    define('ZONG_DOMAIN_URL', "(URL address blocked: See forum rules)");
    $post_data='<?xml version="1.0" encoding="utf-8"?>
    <soap12:Envelope xmlns:xsi="(URL address blocked: See forum rules)" xmlns:xsd="(URL address blocked: See forum rules)" xmlns:soap12="(URL address blocked: See forum rules)">
     <soap12:Body>
    <SendSMS xmlns="(URL address blocked: See forum rules)/">
     <Src_nbr>9145216598</Src_nbr>
     <Password>123</Password>
     <Dst_nbr>913115383168</Dst_nbr>
     <Mask>STAFF</Mask>
     <Message>Test Message from API</Message>
     <TransactionID>'.rand().'</TransactionID>
    </SendSMS>
     </soap12:Body>
    </soap12:Envelope>';
     
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,            ZONG_DOMAIN_URL );
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
    curl_setopt($ch, CURLOPT_POST,           1 );
    curl_setopt($ch, CURLOPT_POSTFIELDS,     $post_data ); 
    curl_setopt($ch, CURLOPT_HTTPHEADER,     array('Content-Type: application/soap+xml', 'charset=utf-8')); 
       echo $result = curl_exec ($ch);
     
    ?>

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.