Current Path :
/
home
/
zrcdevco
/
public_html
/
USD
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/zrcdevco/public_html/USD/gravity_form_test.php
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(~0); set_time_limit(0); date_default_timezone_set("America/New_York"); // Consumer Key - ck_9ba302bb5b04c36e682bd64030cdb5114e16780a // Consumer Secret - cs_5bf0ddbeb99451a53c34d4f1c0fddff9a28b523b $username = 'ck_9ba302bb5b04c36e682bd64030cdb5114e16780a'; $password = 'cs_5bf0ddbeb99451a53c34d4f1c0fddff9a28b523b'; // replace the WP PHP with raw PHP to retrieve entries $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password); // set our url with curl_setopt() curl_setopt($ch, CURLOPT_URL, "https://onlinedegrees.sandiego.edu/wp-json/gf/v2/entries"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // convert to an associative array to handle the // "has-more" value in the output // which is illegal as an object/variable name $response = curl_exec($ch); //$response = json_decode(curl_exec($ch),true); curl_close($ch); /* // Check the response code. if ( wp_remote_retrieve_response_code( $response ) != 200 || ( empty( wp_remote_retrieve_body( $response ) ) ) ) { // If not a 200, HTTP request failed. die( 'There was an error attempting to access the API.' ); } */ var_dump($response); ?>