-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestupload.php
42 lines (39 loc) · 1.15 KB
/
testupload.php
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
<?php
session_start();
include_once("config.php");
$access_token = $facebook->getAccessToken();
/*$json=file_get_contents("https://graph.facebook.com/$user/albums?access_token=$access_token");
$data=json_decode($json,true);
$data=$data['data'];
foreach($data as $album){
$type=$album['type'];
if($type=='profile'){
$profile_album_id=$album['id'];
}
$count++;
}
$facebook->setFileUploadSupport(true);
$file=$_REQUEST['filename'];//'
$args['image'] = '@' . realpath($file);
$data = $facebook->api('/'. $profile_album_id . '/photos?access_token='. $access_token, 'post', $args);
$url = "http://www.facebook.com/photo.php?fbid=$fbid&type=1&makeprofile=1";
$fbid=$data['id'];*/
?>
<script>
document.location='<?php echo $url;?>';
</script>
<?php
$parameters = array(
'app_id' => $facebook->getAppId(),
'to' => $user,
'link' => 'http://google.com/',
'redirect_uri' => 'http://apps.facebook.com/eggmood/testupload'
);
$url = 'http://www.facebook.com/dialog/send?'.http_build_query($parameters);
?>
<script>
function callit(){
window.open('<?php echo json_encode($url); ?>');
}
</script>
<a href="#DAF" onclick="callit();">publish it here </a>