inserire petizione nel propio sito

12 views
Skip to first unread message

Peppe Cp

unread,
May 20, 2016, 12:59:41 PM5/20/16
to Change.org API
salva a tutti,
sto provando ad inserire un modulo personalizzato all'interno del mio sito costruito con joomla.

dalle guide penso che si deve inserire il seguente codice

<?php
$API_KEY = 'example';
$REQUEST_URL = 'https://api.change.org/v1/petitions/get_id';
$PETITION_URL = 'http://www.change.org/petitions/dunkin-donuts-stop-using-styrofoam-cups-and-switch-to-a-more-eco-friendly-solution';
$parameters = array(
  'api_key' => $API_KEY,
  'petition_url' => $PETITION_URL
);
$query_string = http_build_query($parameters);
$final_request_url = "$REQUEST_URL?$query_string";
$response = file_get_contents($final_request_url);
$json_response = json_decode($response, true);
$petition_id = $json_response['petition_id'];
echo $petition_id;
?>

Ho provato ma non si vede.

Qualcuno riesce a dare qualche suggerimento?

Grazia a Voi tutti.

Peppe Cp

unread,
May 24, 2016, 11:10:38 AM5/24/16
to Change.org API
save everyone,
I'm trying to insert a custom form within my site built with Joomla .

the guides I think you should enter the following code

< ? Php
$ Api_key = ' example ' ;
$ REQUEST_URL = ' https://api.change.org/v1/petitions/get_id ' ;
$ PETITION_URL = 'http://www.change.org/petitions/dunkin-donuts-stop-using-styrofoam-cups-and-switch-to-a-more-eco-friendly-solution';
$ Parameters = array (
  ' Api_key ' = > $ api_key ,
  ' Petition_url ' = > $ PETITION_URL
) ;
$ Query_string = http_build_query ( $ parameters ) ;
$ Final_request_url = " $ REQUEST_URL ? $ Query_string " ;
$ Response = file_get_contents ( $ final_request_url ) ;
$ Json_response = json_decode ( $ response , true) ;
$ Petition_id = $ json_response [ ' petition_id ' ] ;
echo $ petition_id ;
? >

I felt but not seen .

Can anyone give some suggestions ?

Grace to you all .
Reply all
Reply to author
Forward
0 new messages