Results 1 to 3 of 3

Thread: PHP Get values from Fields

  1. #1
    Join Date
    Sep 2013

    PHP Get values from Fields

    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.

    //URL to call
    define('ZONG_DOMAIN_URL', "");
    $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">
    <SendSMS xmlns="http://tempuri.org/">
    <Message>"A task is due, Please check your email or Login into the Dashboard."</Message>

    $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);


  2. #2
    Join Date
    Aug 2004
    Not exactly sure what you mean, but it sounds like it might be a job for SimpleXML.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

  3. #3
    Join Date
    Sep 2013
    One solution is mysql_fetch_field — Get column information from a result and return as an object.

    object mysql_fetch_field ( resource $result [, int $field_offset = 0 ] )

    Returns an object containing field information. This function can be used to obtain information about fields in the provided query result.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles