THINKPHP网站登录页在本地测试可以正常登录,在服务器却无法正常跳转
为什么我的网站登录页在本地测试可以正常登录,在服务器却无法正常跳转呢?
<br /><form action="{:U('Login/login')}" method="post"><br /> <ul><br /> <li><img src="/static/imghwm/default1.png" data-src="__PUBLIC__/frontend/images/login_name_bg.gif" class="lazy" alt="" title="用户名"/><br /> <input type="text" class="denglu_srk" placeholder="用户名/邮箱/手机号" value="<?php echo $_COOKIE['username'];?>" name="name" style="max-width:90%"/><br /> </li><br /> <li><img src="/static/imghwm/default1.png" data-src="__PUBLIC__/frontend/images/login_password_bg.gif" class="lazy" alt="" title="密码"/><br /> <input type="password" class="denglu_srk" placeholder="密码" onpaste="return false" name="pass" id="pass_id" style="max-width:90%"/><br /> </li><br /> <?php if($_SESSION['login_time']>=3):?><br /> <li><input placeholder="输入验证码" class="yanzhengma" name="verify"/><img class="verify-code lazy" src="/static/imghwm/default1.png" data-src="{:U('Register/verify')}" Register/verify')}" onClick="click_change(this)" style="max-width:90%" title="验证码"/ alt="THINKPHP网站登录页在本地测试可以通常登录,在服务器却无法正常跳转" ><b id="verify1"></b></li><br /> <?php endif;?><br /> </ul><br /> <p><a href="{:U('FindPass/email')}">忘记密码?</a><a href="{:U('Register/index')}">免费注册</a></p><br /> <div class="denglu_but_con"><input class="denglu_but" type="submit" value=" "/></div><br /> </form><br />


------解决思路----------------------
url 重写没有生效
------解决思路----------------------
还可能是 session 无效
------解决思路----------------------
不对!
http://www.onloan.com.cn/usercontent-index.html
会转到
http://www.onloan.com.cn/login-index.html
所以要么是登录程序有问题(无法确认是用户),要么是 session 失效
------解决思路----------------------
session保存目录可写?
------解决思路----------------------
大麦加油!关注、学习!
------解决思路----------------------
也可能是你的服务器 php 版本低了
$url = 'http://www.onloan.com.cn/usercontent-index.html';<br />print_r(get_headers($url));<br />echo file_get_contents($url);
Array<br />(<br /> [0] => HTTP/1.1 200 OK<br /> [1] => Date: Sun, 05 Oct 2014 05:57:52 GMT<br /> [2] => Content-Type: text/html<br /> [3] => Content-Length: 265<br /> [4] => Connection: close<br /> [5] => Server: nginx/1.0.15<br /> [6] => X-Powered-By: PHP/5.2.17p1<br />)<br /><head><br /><meta property="qc:admins" content="147026777767647166375636" /><br /><meta property="qc:admins" content="4716300527622221636375" /><br /><meta property="qc:admins" content="471630043674556654" /><br /></head><br /><br /><br /><meta http-equiv='Refresh' content='0;URL=/login-index.html'><br />
------解决思路----------------------
再有,你的服务器用的是 nginx
能支持 .htaccess 吗?
------解决思路----------------------
你在登录页打印一下传入的参数看看
这样无目标的瞎猜是没有用的

DependencyInjection(DI)inPHPenhancescodeflexibilityandtestabilitybydecouplingdependencycreationfromusage.ToimplementDIeffectively:1)UseDIcontainersjudiciouslytoavoidover-engineering.2)Avoidconstructoroverloadbylimitingdependenciestothreeorfour.3)Adhe

到Improveyourphpwebsite的實力,UsEthestertate:1)emplastOpCodeCachingWithOpcachetCachetOspeedUpScriptInterpretation.2)優化的atabasequesquesquesquelies berselectingOnlynlynnellynnessaryfields.3)usecachingsystemssslikeremememememcachedisemcachedtoredtoredtoredsatabaseloadch.4)

是的,ItispossibletosendMassemailswithp.1)uselibrarieslikeLikePhpMailerorSwiftMailerForeffitedEmailsending.2)enasledeLaysBetenemailstoavoidSpamflagssspamflags.3))

DependencyInjection(DI)inPHPisadesignpatternthatachievesInversionofControl(IoC)byallowingdependenciestobeinjectedintoclasses,enhancingmodularity,testability,andflexibility.DIdecouplesclassesfromspecificimplementations,makingcodemoremanageableandadapt

使用PHP發送電子郵件的最佳方法包括:1.使用PHP的mail()函數進行基本發送;2.使用PHPMailer庫發送更複雜的HTML郵件;3.使用SendGrid等事務性郵件服務提高可靠性和分析能力。通過這些方法,可以確保郵件不僅到達收件箱,還能吸引收件人。

計算PHP多維數組的元素總數可以使用遞歸或迭代方法。 1.遞歸方法通過遍歷數組並遞歸處理嵌套數組來計數。 2.迭代方法使用棧來模擬遞歸,避免深度問題。 3.array_walk_recursive函數也能實現,但需手動計數。

在PHP中,do-while循環的特點是保證循環體至少執行一次,然後再根據條件決定是否繼續循環。 1)它在條件檢查之前執行循環體,適合需要確保操作至少執行一次的場景,如用戶輸入驗證和菜單系統。 2)然而,do-while循環的語法可能導致新手困惑,且可能增加不必要的性能開銷。

在PHP中高效地哈希字符串可以使用以下方法:1.使用md5函數進行快速哈希,但不適合密碼存儲。 2.使用sha256函數提高安全性。 3.使用password_hash函數處理密碼,提供最高安全性和便捷性。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

Safe Exam Browser
Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。

WebStorm Mac版
好用的JavaScript開發工具

Dreamweaver CS6
視覺化網頁開發工具

記事本++7.3.1
好用且免費的程式碼編輯器

MantisBT
Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。