• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: How can i load a field value in Script called afte

How can i load a field value in Script called afte 9 years 8 months ago #32238

  • sam.samiei
  • sam.samiei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 1
Hi,
im using the following php code in "Script called after form has been processed" to send a sms message to the user.

i was wondering if anyone can help with showing me how i could load the following fields value in the php code.

refrence number: {counter:value}
date: {date:value}
time: {time:value}
mobile: {mobile:value}

$text = urlencode("Confirming your appointment on DATE at TIME. Your reference number is COUNTER.");
$to = "THE MOBILE NUMBER GOES HERE";


SMS code:
    $user = "";
    $password = "";
    $api_id = "";
    $baseurl ="http://api.clickatell.com";
 
    $text = urlencode("Confirming your appointment on Date at Time. Your reference number is Counter.");
    $to = "their mobile number";
 
    // auth call
    $url = "$baseurl/http/auth?user=$user&password=$password&api_id=$api_id";
 
    // do auth call
    $ret = file($url);
 
    // explode our response. return string is on first line of the data returned
    $sess = explode(":",$ret[0]);
    if ($sess[0] == "OK") {
 
        $sess_id = trim($sess[1]); // remove any whitespace
        $url = "$baseurl/http/sendmsg?session_id=$sess_id&to=$to&text=$text";
 
        // do sendmsg call
        $ret = file($url);
        $send = explode(":",$ret[0]);
 
        if ($send[0] == "ID") {
            echo "successnmessage ID: ". $send[1];
        } else {
            echo "send message failed";
        }
    } else {
        echo "Authentication failure: ". $ret[0];
    }

thanks in advance
The administrator has disabled public write access.

How can i load a field value in Script called afte 9 years 8 months ago #32239

  • sam.samiei
  • sam.samiei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 1
for the mobile section, i have used the following code and it worked:
$mobile = $_POST;
$to = "$mobile";

the problem i have is with the text section, the date and counter value shows in text message but the date value shows only as "Array"
$text = urlencode("Date " .$_POST['form']['date']. "at" .$_POST['form']['time']. "Your reference number is " .$_POST['form']['counter'].);

any idea what cause that?
The administrator has disabled public write access.

How can i load a field value in Script called afte 9 years 8 months ago #32243

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Not sure what exactly worked for you, but you can grab the submitted information directly from within the $_POS variable. Example:
$to = $_POST['form']['name of field here'];
//get the current date
$date = date('Y/m/d');
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!