I am working on Dropbox-API php..
My php file just working in CLI.. How to make it works in CGI as well?
this is my search.php
<html>
<pre>
<?php
echo "123";
require_once "dropbox-sdk/Dropbox/autoload.php";
use \Dropbox as dbx;
$accessToken = "xxx";
$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
$_SESSION['Dropbox'] = $dbxClient;
$searchMetadata = $dbxClient->searchFileNames( "/", "soemarko.png", null, false );
print_r($searchMetadata);
$file = "search.json";
file_put_contents($file, json_encode($searchMetadata));
$searchUrl = $dbxClient->createShareableLink("/Soemarko.png");
$link = "link.json";
file_put_contents($link, json_encode($searchUrl));
?>
</pre>
</html>
And i have a form to redirect there in different file..
<form action="search.php" method="POST">
<input type="text" name="query"/>
<input type="Submit" value="Submit">
</form>
Can anyone please help me to make my search.php run in browser? It currently just show blank page..
Even i tried to add
header(Location: 'display.php')
is ignored and keep showing blank page in search.php