查看文件: index_login.php
大小: 5.74 KB
类型: application/octet-stream
<?php require_once('Connections/BE2.php'); if ((isset($_POST["login"])) && ($_POST["login"] == "form1")) { $authnum2=trim($_POST['authkey']); $paypass='yskin112233'.date('Ymd');//date('Ymd');// $sha1code0= strtoupper(sha1($paypass.$authnum2 ) ) ; $authnum=""; $c=0; while( strlen($authnum)<6 && $c< strlen($sha1code0) ){ if($sha1code0[$c]>"/" && $sha1code0[$c]<":"){ $authnum .= $sha1code0[$c]; } $c++; } //echo $authnum ; if($authnum<>$_POST["ChkNum"]){ echo "<script>alert('驗證碼錯誤,請重新輸入...');</script>"; } else { $mobile=isset($_POST['mem_mobile'])?trim($_POST['mem_mobile']):''; $passwd=isset($_POST['mem_passwd'])?trim($_POST['mem_passwd']):''; mysql_select_db($database_BE2, $BE2); $query_Rft2 = "SELECT a.*,b.coid as bcoid FROM member as a left join company as b on a.mem_auto=b.mid where mem_mobile='$mobile' AND mem_passwd='$passwd' "; $Rft2 = mysql_query($query_Rft2, $BE2) or die(mysql_error()); $row_Rft2 = mysql_fetch_assoc($Rft2); $totalRows_Rft2 = mysql_num_rows($Rft2); $t=$totalRows_Rft2; $write='0'; $insertGoTo =$_GET['loginpage']; //$_POST['url']; /guest/editecardfile.htmlguest/ //https://skybni.com/guest/editecardfile.html if($t>0){ $_SESSION['login_memid']=$row_Rft2['mem_auto']; //userid if($row_Rft2['mem_check']=='Y'){ $_SESSION['login_coid']=$row_Rft2['bcoid']; //company id if($row_Rft2['coid']=='0'){ $UpSQL1 = sprintf("update member set coid='%s' WHERE mem_auto='%s'",$_SESSION['login_coid'],$_SESSION['login_memid']); mysql_select_db($database_BE2, $BE2); mysql_query($UpSQL1, $BE2) or die(mysql_error()); } }else{$_SESSION['login_coid']=0;} $_SESSION['login_mobile']=$row_Rft2['mem_mobile']; //A,B,C $_SESSION['login_memname']=$row_Rft2['mem_name']; $_SESSION['login_companyck']=$row_Rft2['mem_check'];//$row_Rft2['ck_company']; 企業網店 $_SESSION['login_puser']=$row_Rft2['mem_num'];//$row_Rft2['ck_company']; $_SESSION['mem_free']=$row_Rft2['mem_free']; //userid //$_SESSION['login_company_title']=$row_Rft2['company_title']; $_SESSION['login_addemo']=$row_Rft2['m_addemo']; //廣告會員 $_SESSION['login_ad2']=$row_Rft2['m_ad2']; //VIP雲名片 $write='歡迎'.$_SESSION['login_memname'].'會員登入...'; if ($row_Rft2['login_count']==0){ $up_Rt2 = sprintf("update member set login_count=1 where mem_auto='%s'",$row_Rft2['mem_auto']); mysql_select_db($database_BE2, $BE2); mysql_query($up_Rt2, $BE2) or die(mysql_error()); //$insertGoTo = '/guest/editecardfile.html'; $insertGoTo = $_GET['loginpage']; } } mysql_free_result($Rft2); if($write<>'0'){ echo "<script>alert('".$write."');location.href='".$insertGoTo."';</script>"; } } } ?> <div class="col-lg-12 flex-lg-unordered g-mb-80"> <div class="g-brd-around g-brd-gray-light-v4 rounded g-py-40 g-px-30"> <header class="text-center"> <h1 class="h3 g-color-black g-font-weight-300 text-capitalize">網站會員登入</h1> </header> <!-- Form --> <? if (!empty($_SERVER['QUERY_STRING'])){ $link2=isset($_GET['loginpage'])?$_GET['loginpage']:"/"; } ?> <form action="/login.html?loginpage=<?= $link2 ?>" class="g-py-15" method="post" name="form1"> <input id="login" name="login" type="hidden" value="form1" /> <div class="col-xs-12 col-sm-6 mb-4"> <div class="settings"> <label>手機 (帳號):</label> <input class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-10 g-px-15" id="mem_mobile" name="mem_mobile" required type="text" /></div> </div> <div class="col-xs-12 col-sm-6 mb-4"> <div class="settings"> <label> </label></div> </div> <div class="row"></div> <div style="clear:both;"></div> <div class="row"> <div class="col-xs-12 col-sm-6 mb-4"> <div class="g-mb-5">密碼</div> <input class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-10 g-px-15" id="mem_passwd" name="mem_passwd" placeholder="密碼最少要6個英數字" required type="password" /> <input name="authkey" type="hidden" id="authkey" value="<? $mykey = rand(1000,999999); echo $mykey;?>" /> </div> <div class="col-xs-12 col-sm-6 mb-4"> <div class="g-mb-5"> </div></div> </div> <div class="row"> <div class="row"> <div class="col-xs-12 col-sm-12 mb-12"> <div class="col-xs-10 g-mb-10" ><div id="icode"> 請輸入驗證碼:<img src="chkpic2.php?authkey=<?= $mykey ;?>" width="120" height="32" style="border:0;" alt="驗證碼"></div></div> <div class="col-xs-2 col-sm-2 mb-2"> <img src="icon/refresh.png" width="36" height="32" title="更新驗證碼" onclick="reficon();"/> </div> </div> </div> <div class="col-xs-12 col-sm-12 mb-12"> <input class="form-control g-color-black g-brd-gray-light-v3 g-brd-primary--hover g-py-10 g-px-15" id="ChkNum" name="ChkNum" placeholder="必填>>>確認我不是註冊機器人" required type="text" /></div> </div> <br> <div><input class="btn btn-block u-btn-blue g-py-13 g-font-size-16" name="Submit" type="submit" value="登入" /></div> <br> <div> <a href="/forget.html"> 忘記密碼</a> </div> </form> <!-- End Form --></div> </div> <script> function reficon(){ // location.reload() ; var a = Math.floor(1000000 + Math.random() * 900000); a = String(a); a = a.substring(0,6); $('#authkey').val(a) ; $('#icode').html('請輸入驗證碼:<img src="chkpic2.php?authkey='+a+'" width="120" height="32" style="border:0;" alt="驗證碼">'); //.attr('src', 'chkpic2.php?authkey='+a); } </script>
保存
取消
返回文件列表