示例#1
0
<?php

if ($_POST['submit'] == '上传') {
    include_once 'saet.ex.class.php';
    $akey = '98045090';
    //AppKey
    $asec = '07fb0ec46141e0bd0563fec0f6e368ed';
    //AppSecret
    $token = 'acabbae36448457402e32290cfb67220';
    //AccessToken
    $tsec = '44b90eae427cbcfaa72ac02d97263e62';
    //AccessSecret
    $so = new SaeTClient($akey, $asec, $token, $tsec);
    $x = '#分享图片# 随机序号:' . rand(1, 99999) . '[ http://7130.sinaapp.com/ ]';
    $return = $so->upload($x, $_FILES['element_1']['tmp_name']);
    $original_pic = $return['original_pic'];
    //图片的地址
    $thumbnail_pic = $return['thumbnail_pic'];
    //缩略图地址
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>图床</title>
<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script type="text/javascript" src="view.js"></script>

</head>
<body id="main_body" >