test - PHP Online
Form of PHP Sandbox
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of test.php
- <?php
- // Script to access REST API: https://ssl.eventilla.com/v1/
- $accountID = 2115435; // data provided
- $key = "d48c7f4a664fb763f0ca657a2f54de03e235a048e5e0fff58a82680aac324c9d"; // data provided
- // Fetch all events where the user has access to
- $uri = "https://ssl.eventilla.com/v2/events/";
- // Fetch information about attendee with id 123456
- // Fields can be left out to speed up the query
- //$uri = "https://ssl.eventilla.com/v2/events/123456/attendees?fields=firstname,lastname,email,data,ticket,registered,status";
- // Fetch information about event with hashid ABCD12
- //$uri = "https://ssl.eventilla.com/v2/events/ABCD12/attendees?fields=firstname,lastname,email";
- // Get all attendees and their information from event ABCD12
- //$uri = "https://ssl.eventilla.com/v2/events/ABCD12/attendees?fields=firstname,lastname,email,data,ticket,links,registered,status,invoice,extras,transaction";
- // Fetch information about event with hashid ABCD12 in Finnish (event description, location, form fields can be translated)
- //$uri = "https://ssl.eventilla.com/v2/events/ABCD12?language=FI";
- // Fetch only events that are in published state and their start_date is in the future
- //$uri = 'https://ssl.eventilla.com/v2/events/?published=true&past_events=false';
- $uriPath = parse_url($uri)["path"];
- $method = "GET";
- $date = gmdate('D, d M Y H:i:s T');
- $contentMD5 = "";
- $contentType = "";
- $dataString = $method . "\n" . $contentMD5 . "\n" . $contentType . "\n" . $date . "\n" . "\n" . $uriPath;
- $sha1 = hash_hmac('sha1', $dataString, $key, true);
- $base64 = base64_encode($sha1);
- // Get cURL resource
- $curl = curl_init();
- // Set some options
- curl_setopt_array($curl, array(
- CURLOPT_RETURNTRANSFER => 1,
- CURLOPT_URL => $uri,
- CURLOPT_HTTPHEADER => ["Date: $date", "Content-MD5: $contentMD5", "Content-Type: ", "Authorization: KVWS $accountID:$base64"],
- CURLOPT_VERBOSE => true
- ));
- // Send the request & save response to $resp
- $resp = curl_exec($curl);
- // Close request to clear up some resources
- curl_close($curl);
- var_dump($resp);
File Description
- test
- PHP Code
- 12 Sep-2019
- 2.02 Kb
You can Share it:
Latest PHP Pastes