<? session_start(); include('weibo_time.class.php'); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>定时微博</title> </head> <body> <? $new=new sina_weibo(); echo '<a href="'.$new->callback('callback.php').'">oauth认证</a>'; ?> </body> </html>
<? session_start(); include('weibo_time.class.php'); $new=new sina_weibo(); if(!$new->check_login()){//用于检查是否已经登陆 echo "你还没有登陆"; exit; } echo $_SESSION['id']; if(isset($_POST['text'])){ $time=trim($_POST['time']); $pic=trim($_POST['pic']); $e=$new->new_weibo($_POST['text'],$pic,$time); print_r($e); }else{ echo "你还没有写微博内容"; } echo $e; ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>定时微博</title> </head> <body> <form method="POST">
<? session_start(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>定时微博</title> </head> <body> <? include('weibo_time.class.php'); $new=new sina_weibo(); $user_id=$new->get_user_id(); if($new->check_login()){ //用于检查是否已经登陆 echo "认证成功<br/>"; echo "<a href='weibo.php'>跳转进去</a><br/>"; if(!$new->check_person($user_id)){ //新增用户 if($new->new_person($user_id)){ echo "添加用户成功."; print_r($_SESSION['keys']); }else{ echo "添加用户失败"; print_r($_SESSION['keys']); } }else{ echo "失败因数据库存在此用户"; print_r($_SESSION['keys']);