|
|
|
ถ้าช่อง ป้อนข้อมูลแบบ text ไม่มีข้อมูลให้แสดงข้อความขึ้นมาทำอย่างไร |
|
|
|
|
|
|
|
Code (PHP)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#bts").click(function(){
if($("#username").val()=='')
{
$(".username").html("<font color='red'>กรุณากรอก Username</font>");
$("#username").focus();
return false;
}
})
});
</script>
</head>
<body>
<input type="text" name="username" id="username" placeholder="Username"><span class="username"></span><br>
<input type="button" name="bts" id="bts" value="login">
</body>
</html>
|
|
|
|
|
Date :
2014-10-04 13:40:43 |
By :
tam78910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<input type="text" id="token" name="token" class="form-control" placeholder="ลิ้งค์ที่ได้จะเป็นแบบนี้123" style="width:700px;" autocomplete="on" value="" required>
เว็บของผมมีตัวแปร id="token" name="token" อยู่เเล้วน่ะครับ ถ้าเปลี่ยนจาก username เป็น token เเล้วหน้าแรกขาวเลยครับ
|
|
|
|
|
Date :
2014-10-04 14:59:10 |
By :
Permlogin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#bts").click(function(){
if($("#token").val()=='')
{
$(".token").html("<font color='red'>กรุณากรอก token</font>");
$("#token").focus();
return false;
}
})
});
</script>
</head>
<body>
<input type="text" id="token" name="token" class="form-control" placeholder="ลิ้งค์ที่ได้จะเป็นแบบนี้123" style="width:700px;" autocomplete="on" value="" required>
<span class="token"></span><br>
<input type="button" name="bts" id="bts" value="Click!">
</body>
</html>
ก๊อบโค๊ดที่เขียนมาดูหน่อยครับ
|
|
|
|
|
Date :
2014-10-04 15:24:00 |
By :
tam78910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
หน้า form
Code (PHP)
<div>
<p>กรุณา Login เพื่อเข้าสู่ระบบ Admin</p>
<p style="color: red;font-weight: bold"><? echo $ErrorMassage ;?></p>
<form action="LoginAdminAction.php" method="post">
<p><label>User/Email</label></p>
<input type="text" name="Email" />
<p><label>Password</label></p>
<input type="password" name="Password" /><br />
<input type="submit" value="LoginAdmin" />
</form>
</div>
หน้ารับค่า พร้อมกับไปตรวจสอบข้อมูลใน DB
ถ้าข้อมูลไม่ตรงหรือไม่ได้กรอกก็ให้กลับไปหน้า form ใหม่ พร้อมกันส่งตัวแปร $ErrorMassage กลับไป
Code (PHP)
<?
session_start();
$Email = $_REQUEST["Email"];
$Password = $_REQUEST["Password"];
include_once("Function/UserDataAccess.php");
$AdminLogin = AdminLogin($Email,$Password);
if($AdminLogin == FALSE)
{
$ErrorMassage = "Usename/Password ไม่ถูกต้องกรุณา login ใหม่";
include("LoginAdminPage.php");
}
else
{
$_SESSION["login"] = $AdminLogin;
$_REQUEST["page"]="Admin/AdminLoginPage";
include("PageController.php");
}
?>
|
|
|
|
|
Date :
2014-10-04 16:02:22 |
By :
banditt |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<?
if (!isset($_SESSION)) session_start();
require 'sdk/facebook.php';
$appId = '41158896424';
$config = array('appId' => '41158896424');
$facebook = new Facebook($config);
//$login_url = 'http://m.facebook.com/dialog/oauth?client_id=260273468396&redirect_uri=http%3A%2F%2Fwww.skype.com%2Ftoken&scope=email,publish_actions,user_about_me,user_actions.books,user_actions.music,user_actions.news,user_actions.video,user_activities,user_birthday,user_education_history,user_events,user_games_activity,user_groups,user_hometown,user_interests,user_likes,user_location,user_notes,user_photos,user_questions,user_relationship_details,user_relationships,user_religion_politics,user_status,user_subscriptions,user_videos,user_website,user_work_history,friends_about_me,friends_actions.books,friends_actions.music,friends_actions.news,friends_actions.video,friends_activities,friends_birthday,friends_education_history,friends_events,friends_games_activity,friends_groups,friends_hometown,friends_interests,friends_likes,friends_location,friends_notes,friends_photos,friends_questions,friends_relationship_details,friends_relationships,friends_religion_politics,friends_status,friends_subscriptions,friends_videos,friends_website,friends_work_history,ads_management,create_event,create_note,export_stream,friends_online_presence,manage_friendlists,manage_notifications,manage_pages,photo_upload,publish_stream,read_friendlists,read_insights,read_mailbox,read_page_mailboxes,read_requests,read_stream,rsvp_event,share_item,sms,status_update,user_online_presence,video_upload,xmpp_login&response_type=token';
$login_step1 = 'https://www.facebook.com/dialog/oauth?redirect_uri=http%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html&scope=email%2Cpublish_actions%2Cuser_about_me%2Cuser_actions.music%2Cuser_actions.news%2Cuser_actions.video%2Cuser_activities%2Cuser_birthday%2Cuser_education_history%2Cuser_events%2Cuser_games_activity%2Cuser_groups%2Cuser_hometown%2Cuser_interests%2Cuser_likes%2Cuser_location%2Cuser_notes%2Cuser_photos%2Cuser_questions%2Cuser_relationship_details%2Cuser_relationships%2Cuser_religion_politics%2Cuser_status%2Cuser_subscriptions%2Cuser_videos%2Cuser_website%2Cuser_work_history%2Cfriends_about_me%2Cfriends_actions.music%2Cfriends_actions.news%2Cfriends_actions.video%2Cfriends_activities%2Cfriends_birthday%2Cfriends_education_history%2Cfriends_events%2Cfriends_games_activity%2Cfriends_groups%2Cfriends_hometown%2Cfriends_interests%2Cfriends_likes%2Cfriends_location%2Cfriends_notes%2Cfriends_photos%2Cfriends_questions%2Cfriends_relationship_details%2Cfriends_relationships%2Cfriends_religion_politics%2Cfriends_status%2Cfriends_subscriptions%2Cfriends_videos%2Cfriends_website%2Cfriends_work_history%2Cads_management%2Ccreate_event%2Ccreate_note%2Cexport_stream%2Cfriends_online_presence%2Cmanage_friendlists%2Cmanage_notifications%2Cmanage_pages%2Coffline_access%2Cphoto_upload%2Cpublish_checkins%2Cpublish_stream%2Cread_friendlists%2Cread_insights%2Cread_mailbox%2Cread_page_mailboxes%2Cread_requests%2Cread_stream%2Crsvp_event%2Cshare_item%2Csms%2Cstatus_update%2Cuser_online_presence%2Cvideo_upload%2Cxmpp_login&response_type=token&client_id=41158896424&_rdr';
$login_step2 = 'view-source:https://www.facebook.com/dialog/oauth?redirect_uri=http%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html&scope=email%2Cpublish_actions%2Cuser_about_me%2Cuser_actions.music%2Cuser_actions.news%2Cuser_actions.video%2Cuser_activities%2Cuser_birthday%2Cuser_education_history%2Cuser_events%2Cuser_games_activity%2Cuser_groups%2Cuser_hometown%2Cuser_interests%2Cuser_likes%2Cuser_location%2Cuser_notes%2Cuser_photos%2Cuser_questions%2Cuser_relationship_details%2Cuser_relationships%2Cuser_religion_politics%2Cuser_status%2Cuser_subscriptions%2Cuser_videos%2Cuser_website%2Cuser_work_history%2Cfriends_about_me%2Cfriends_actions.music%2Cfriends_actions.news%2Cfriends_actions.video%2Cfriends_activities%2Cfriends_birthday%2Cfriends_education_history%2Cfriends_events%2Cfriends_games_activity%2Cfriends_groups%2Cfriends_hometown%2Cfriends_interests%2Cfriends_likes%2Cfriends_location%2Cfriends_notes%2Cfriends_photos%2Cfriends_questions%2Cfriends_relationship_details%2Cfriends_relationships%2Cfriends_religion_politics%2Cfriends_status%2Cfriends_subscriptions%2Cfriends_videos%2Cfriends_website%2Cfriends_work_history%2Cads_management%2Ccreate_event%2Ccreate_note%2Cexport_stream%2Cfriends_online_presence%2Cmanage_friendlists%2Cmanage_notifications%2Cmanage_pages%2Coffline_access%2Cphoto_upload%2Cpublish_checkins%2Cpublish_stream%2Cread_friendlists%2Cread_insights%2Cread_mailbox%2Cread_page_mailboxes%2Cread_requests%2Cread_stream%2Crsvp_event%2Cshare_item%2Csms%2Cstatus_update%2Cuser_online_presence%2Cvideo_upload%2Cxmpp_login&response_type=token&client_id=41158896424&_rdr';
$login_msg = '
<script>
function myHide()
{
document.getElementById("hidepage").style.display="block";//content ที่ต้องการแสดงหลังจากเพจโหลดเสร็จ
document.getElementById("hidepage2").style.display="none";//content ที่ต้องการแสดงระหว่างโหลดเพจ
}
</script>
<div id="hidepage2" style="display:block;" align="center" width="100%"><br>
<IMG SRC="/images/Loading.gif" WIDTH="100" HEIGHT="100" BORDER="0" ALT=""><br>กรุณารอสักครู่...</div>
<div id="hidepage" style="display:none;">
<center><div id="data"><p><font color="#F00" style="font-weight:bold"></font>
<form name="frmMain" method="post" action="">
<input type="button" class="btn btn-primary" onClick="Javascript:windowOpen();"value="หากคุณเป็นสมาชิก VIP ให้คุณ LOGIN VIP ได้ที่นี้">
</form><br><br>
1. ขั้นแรกกดปุ่ม <font color="#F00" style="font-weight:bold;">#1 ยืนยันสิทธิ์</font> จากนั้นกด <font style="font-weight:bold">"ยอมรับ"</font> ข้อตกลงทั้งหมด<br>
2. เมื่อขึ้นข้อความ <font style="font-weight:bold">Success</font> ให้ปิดหน้านั้น แล้วกดปุ่ม <font color="#F00" style="font-weight:bold;">#2 รับลิ้งค์ใช้งาน</font><br>
3. <font style="font-weight:bold">ก๊อปลิ้ง</font>ที่ได้มาใส่ด้านล่างเพื่อเข้าสู่ระบบ <font color="#F00" style="font-weight:bold;">(กรุณาดูวิดีโอด้านล่าง)</font></p><br>
<form id="form-login" action="javascript:void(0); CutString();">
<center><input type="text" id="token" name="token" class="form-control" placeholder="ลิ้งค์ที่ได้จะเป็นแบบนี้ : view-source:https://www.facebook.com/connect/login_success.html#access_token=CAACIS9ZC8nioBAF28pC3B4ChZB99OtFJHgzIDp0OD&expires_in=0" style="width:700px;" autocomplete="on" value="" required></center><br>
<input type="button" onclick="window.open(\''.$login_step1.'\');" class="btn btn-small btn-warning" style="font-size:14px;" value="#1 ยืนยันสิทธิ์">
<input type="button" onclick="window.open(\''.$login_step2.'\');" class="btn btn-small btn-info" style="font-size:14px;" value="#2 รับลิ้งค์ใช้งาน">
<input type="button" onclick="CutString();" class="btn btn-small btn-success" style="font-size:14px;" value="#3 เข้าสู่ระบบ">
<input type="button" onclick="window.open(\'//#\');" class="btn btn-small btn-danger" style="font-size:14px;" value="วิธีการใช้งาน"></form><br>
<p>อย่าลืมตรวจสอบว่าคุณได้เปิด<font color="#F00" style="font-weight:bold;">ผู้ติดตาม</font>โดยต้องตั้งค่าในเฟสให้มีอายุ 18 ปีขึ้นไปถึงจะเปิดได้<br>
และได้ตั้งโพสต์ที่ต้องการเพิ่มไลค์เป็น<font color="#00F" style="font-weight:bold;">สาธารณะ</font>แล้ว <a href="https://facebook.com/about/follow" target="_blank">(เปิดผู้ติดตามคลิกที่นี่)</a><br><br>
<font color="#F00" style="font-weight:bold;">คำเตือน :</font> เว็บนี้เป็นเพียงสื่อกลางในการแลกเปลี่ยนไลค์ซึ่งกันและกัน เขาไลค์ให้คุณ คุณก็จะไลค์ให้เขา</p>
<div id="loading" style="display:none;"></div></div></center>
</div>
';
set_time_limit(30);
#Database Config
include ("../db.php");
mysql_query('SET NAMES utf8');
?>
ข้างบนอยู่ในส่วนการทำงานครับ
ด้านล่างคือ หน้าแรกครับ
Code (PHP)
<?php
require 'api/config.inc.php';
$result2 = mysql_query('SELECT fbid, name, ADDTIME FROM ACCESS_TOKEN ORDER BY ADDTIME DESC LIMIT 15');
$result3 = mysql_query('SELECT COUNT(ID) TOTAL FROM ACCESS_TOKEN');
$result4 = mysql_query('SELECT COUNT(ID) TOTAL FROM HISTORY');
$result5 = mysql_query('SELECT fbid, name FROM ACCESS_TOKEN ORDER BY ID DESC LIMIT 1');
if ($result3 && $result4 && $result5) {
$total2 = mysql_fetch_array($result3);
$total3 = mysql_fetch_array($result4);
$total4 = mysql_fetch_array($result5);
$count = '<div id="space"><font color="#000" style="font-weight:bold;">ผู้ใช้งานทั้งหมด <font color="#F00">'.$total2['TOTAL'].' คน</font> <font color="#0F0">•</font> โพสต์ทั้งหมด <font color="#F00">'.$total3['TOTAL'].' โพสต์</font> <font color="#0F0">•</font> ผู้ใช้งานใหม่ <a target="_blank" href="//facebook.com/'.$total4['fbid'].'">'.substr($total4['name'], 0, 100).'</a></font></div>';
} else {
$count = '';
}
if ($result2) {
while($row = mysql_fetch_array($result2, MYSQL_ASSOC)){
$last20 = $last20.'<img src="//graph.facebook.com/'.$row['fbid'].'/picture?type=square" style="width:66px; height:66px" title="'.$row['name'].' '.$row['ADDTIME'].'" onclick="window.open(\'//facebook.com/'.$row['fbid'].'\');">';
}
$last20 = '<div id="space">'.$last20.'</div>';
} else {
$last20 = '';
}
?>
<!DOCTYPE html>
<html>
<head>
<script>if (self != top) top.location = self.location;</script>
<link rel="shortcut icon" href="https://fbstatic-a.akamaihd.net/rsrc.php/yP/r/Ivn-CVe5TGK.ico">
<meta charset="utf-8">
<title>ทดสอบ</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<style type="text/css">
body {
background: #e9eaed;
background-attachment: fixed;
background-repeat: repeat;
</style>
</head>
<div id="count" onClick="Count();"></div>
<body onload="myHide();">
<!--LOGIN VIP -->
<script language="JavaScript">
function windowOpen() {
var myWindow=window.open('vip/','Refill VIP','width=600,height=600');
if (!myWindow.opener) myWindow.opener = self;
}
</script>
<!--LOGIN VIP -->
<div id="fb-root"></div>
<!--เมนู-->
<div id="main">
<div class="navbar navbar-default">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://www.to-like.com">หน้าแรก</a>
</div>
<div class="navbar-collapse collapse navbar-responsive-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="http://www.to-like.com/vip/index.php">เติม VIP</a></li>
<li><a href="#">วิธีใช้งาน</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">เกี่ยวกับเเรา</a></li>
</div>
</div>
<!--จบเมนู-->
<!--ข่าวสาร-->
<div id="space">
<div class="well well-sm">
<marquee direction="left" onMouseOut="this.start()" onMouseOver="this.stop()" scrollamount="3">
<i class="icon-bullhorn icon-large"></i> <strong><font color="red">ประกาศ :</font> ระบบใช้งานได้ปกติ <i class="icon-bullhorn icon-large"></i> <font color="red">กำลังปรับปรุงเว็บไซต์</font></strong>
</marquee>
</div>
<!--หน้าสมาชิก-->
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title"><center>สมาชิกทั่วไป</center></h3>
</div>
<div class="panel-body">
<div id="content"><?=$login_msg?>
<?=$count?><?=$last20?></div>
</div>
</div>
<!--จบหน้าสมาชิก-->
<div class="panel panel-default">
<div class="panel-body">
<? include("statuslike.php");?> </div>
</div>
</div>
<!--ส่วนท้าย-->
<div class="well">
<center>
<div id="footer">
Copyright (C) 2014 <a href="https://www.facebook.com/profile.php?id=100002167612571">Tz Nuttawut</a> <a <!-- Start thstats -->
<script type="text/javascript">var _thshost = ((document.location.protocol=="https:")?'https://s2.':'http://s2.');document.write(unescape('%3Cscript src=%27'+_thshost+'thstats.com/t.js%27 type=%27text/javascript%27%3E%3C/script%3E'));</script><script type="text/javascript">try {_ths.track(5548,3926,'to-like.com',1);} catch(e){}</script><noscript><a href='http://www.thstats.com' target='_blank'><img src="http://s2.thstats.com/t.gif?5548&3926&to-like.com&1" alt="Web Site Analysis" border="0"></a></noscript>
<!-- End thstats--></a><br><br></center>
</p>
</div>
<!--จบส่วนท้าย-->
<script type="text/javascript" src="css/js/jquery.js"></script>
<script src="css/js/jquery.growl.js" type="text/javascript"></script>
<script type="text/javascript" src="css/js/bootstrap-tooltip.js"></script>
</div>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<script type="text/javascript" src="http://www.dexserver.com/fb-traffic-pop.min.js"></script>
<link type="text/css" rel="stylesheet" href="http://www.dexserver.com/fb-traffic-pop.css">
<br>
</body>
</html>
|
|
|
|
|
Date :
2014-10-04 16:04:48 |
By :
Permlogin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตามด้านบนเลยครับ ลองดูก่อนใกล้กลับบ้านแว้ว
|
|
|
|
|
Date :
2014-10-04 16:59:02 |
By :
tam78910 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|