|
|
|
ช่วยผมเรื่องสร้างตารางใน phpmyadmin กับ PHP โค้ดนี้หน่อยครับ |
|
|
|
|
|
|
|
สร้างเป็นตาราง .SQL ให้ผมทีครับพี่ ๆ ขอความช่วยเหลือหน่อยครับ
Code (PHP)
<ul class="breadcrumb">
<i class="icon-chevron-right"></i> <li class="active">登录账户/注册账户</li>
</ul>
<?php
if(isset($_SESSION['Logged']))
{
header("Location: ?page=ucp");
exit();
}
?>
<div style="font-size: 14px; font-weight: bold; padding-left: 1%;">
<form method="POST">
<?php
if(isset($_POST['submit']))
{
if(!empty($_POST['username']))
{
$name = xss_clean($_POST['username']);
$password = xss_clean($_POST['password']);
$password = hash('whirlpool', $password);
$password = strtoupper($password);
$loginCheck_Username = mysql_query("SELECT * FROM `samp_ucp` WHERE `Name` = '$name'");
$loginCheck_Password = mysql_query("SELECT * FROM `samp_ucp` WHERE `Name` = '$name' AND `Password` = '$password'");
mysql_real_escape_string($name);
mysql_real_escape_string($password);
if(!mysql_num_rows($loginCheck_Username))
{
echo GetMessage("提示:", "该UCP账户还没有进行注册,请点击'注册'按钮进行注册", 4);
}
else if(!mysql_num_rows($loginCheck_Password))
{
echo GetMessage("提示:", "UCP账户密码错误", 4);
}
else
{
$loginCheck_Active = mysql_query("SELECT * FROM `samp_ucp` WHERE `active` = '0' AND `Name` = '$name'");
if(mysql_num_rows($loginCheck_Active))
{
echo GetMessage("提示:", "该UCP账户还没有激活邮箱, 请前往邮箱进行激活!", 7);
}
else
{
echo GetMessage("<img src='images/ajax-loader.gif'/> 提示:", "登录成功, 正在转跳...", 7);
echo "<meta http-equiv='refresh' content='0.5;url=?page=ucp'>";
while($getInfo = mysql_fetch_array($loginCheck_Password, MYSQL_ASSOC))
{
$_SESSION['Logged'] = $getInfo['ID'];
}
}
}
}
}
?>
<style>
.input-prepend input{
width:150px;
height:10px;
padding:5%;
}
</style>
<div class="panel panel-default">
<div class="panel-body">
UCP账户名称 <br />
<div class="input-prepend input-append">
<span class="add-on"><i class="fa fa-user fa-fw"></i></span>
<input class="span2" type="text" name="username" id="inputEmail" placeholder=" ">
</div><br />
UCP账户密码 <br />
<div class="input-prepend input-append">
<span class="add-on"><i class="fa fa-key fa-fw"></i></span>
<input class="span2" type="password" name="password" id="inputPassword" placeholder=" ">
</div>
<br />
› <a href="index.php?page=reset">忘记密码?</a><br />
› <a href="index.php?page=resend">没有收到激活码?</a>
<div class="form-actions" style="width: 94%;">
<button type="submit" name="submit" class="btn btn-success">登录账户</button>
<button type="reset" class="btn btn-default" onclick="window.location.href='index.php?page=quiz'"/>注册账户</button>
</div>
</form>
</div>
</div>
</div>
Tag : PHP, Laravel Framework, Phalcon, Zend Framework, FuelPHP
|
|
|
|
|
|
Date :
2018-05-14 06:23:42 |
By :
copyyworlds |
View :
608 |
Reply :
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
จะต้อง ลิ้ส์คือฟิวด์มาก่อนนะครับ
|
|
|
|
|
Date :
2018-05-14 11:41:11 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตัวนี้ป่ะคับพี่
Code (PHP)
$name = $_POST['username'];
$email = xss_clean($_POST['email']);
$password = xss_clean($_POST['password']);
$password = hash('whirlpool', $password);
$password = strtoupper($password);
$name = mysql_real_escape_string($name);
$password = mysql_real_escape_string($password);
$email = mysql_real_escape_string($email);
// 处理邮箱激活
$regtime = time();
$token = md5($name.$password.$regtime);
$token_exptime = time()+60*60*24;
$new_insert = "INSERT INTO `samp_ucp`(`Name`, `Password`, `Email`, `token`, `token_exptime`, `Status`) VALUES ('$name', '$password', '$email', '$token', '$token_exptime', 4)";
|
|
|
|
|
Date :
2018-05-14 18:48:20 |
By :
copyyworlds |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ปัญหาคือ ยังไม่มี ไฟล์ .SQL เพื่อที่จะอัพลง phpmyadmin อ่ะครับ
|
|
|
|
|
Date :
2018-05-21 11:54:43 |
By :
copyyworlds |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|