• 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: I will pay for help!

I will pay for help! 8 years 2 months ago #36474

Please help! I need a Scripts called on form process, to validate a field, so when someone complete the form, go to check if the data exist, and if its exist, then the process complete.

The application they used is json, i dont have a clue of how to do it.

Here is the info they gave me:

url: ccma.mx/voz_mujers/ PRPRJS87120605H000
method: GET
body : Not necessary
Positive:
{
"status": "sucess"
}
Negative:
{
"status": "error"

Thank you so much in advance!
The administrator has disabled public write access.

I will pay for help! 8 years 1 month ago #36551

  • Kevin.brackley
  • Kevin.brackley's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 3
Did you solve your problem? Are you familiar with how to write a php routine and place it in the PHP script on the RSForm's On Form Process?

Depending on your server you can use either file_get_contents (if allow_url_fopen is enabled on your server) if not, you can use curl if that is enabled in your php configuration.

Then you can retrieve your json response from your external provider and check for the result you are looking for. If it fails with status:error I'm assuming you would want to invalidate the form, etc. Like...
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "https://ccma.mx/voz_mujers/PRPRJS87120605H000");
$json = curl_exec($ch);
curl_close($ch);
$jsonobj = json_decode($json);
$result = $jsonobj->status;
// $result will be either 'success' or 'error' ... change the url to reflect the params you wish to pass to the service
Last Edit: 8 years 1 month ago by Kevin.brackley.
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!