forked from seantomburke/Dropbox-PHP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
45 lines (36 loc) · 703 Bytes
/
example.php
File metadata and controls
45 lines (36 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
require_once 'Dropbox.class.php';
$dropbox = new Dropbox();
$userArray = $dropbox->get('https://api.dropbox.com/1/account/info');
?>
<html>
<head>
<title>Dropbox API</title>
</head>
<body>
<h1>Dropbox API</h1>
<?php
if($dropbox->hasAccess())
{
echo '
<h2>User Info</h2>
<ul>
<li>'.$userArray->display_name.'</li>
<li>'.$userArray->email.'</li>
</ul>
<a href="test.php">Put Test File</a>
<form action="get.php" method="GET">
<label>File name to get:</label>
<input type="text" name="path"/>
<input type="submit" />
';
}
else
{
echo '
<h2>Login</h2>
<a href="'.$dropbox->getAccessURL().'">Login to Dropbox</a>';
}
?>
</body>
</html>