Ejemplo n.º 1
0
<?php

require 'classes/envato.api.class.php';
if (isset($_POST['submit'])) {
    extract($_POST);
    if (!empty($pcode)) {
        $API = new EnvatoAPI();
        $API->set_purchase_code($pcode);
        $result = $API->request();
    }
}
?>
<!DOCTYPE html>
<html>
<head>
	<title>Envato Script</title>
	<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<h1>Download Your Items</h1>
<form method="post" action="">
	<p>Purchase Code</p>
	<input type="text" name="pcode"/>
	<input type="submit" name="submit"/>
</form>

<?php 
if (!empty($result['download-purchase'])) {
    ?>
	
	<p><a href="<?php 
Ejemplo n.º 2
0
        // var_dump($url);
        $ch = curl_init();
        $timeout = 0;
        // set to zero for no timeout
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer {$this->token}"));
        $results = curl_exec($ch);
        curl_close($ch);
        // display file
        return json_decode($results);
    }
}
// end EnvatoAPI;
$api = new EnvatoAPI();
var_dump($api->getResults($_POST));
// Get our class file
require "app.php";
$app = new WhatPress();
?>
<!DOCTYPE html>
<html lang="en" class="no-js">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    
    <title><?php 
echo $app->name;
?>