域名設(shè)置 phpstudy怎么運(yùn)行thinkphp?
phpstudy怎么運(yùn)行thinkphp?安裝phpstudy后,運(yùn)行軟件。首先,將TP程序放到一個(gè)web目錄uthinkphp(可定制)openphpstudy中,右邊有一個(gè)PHP版本。在其他選項(xiàng)菜
phpstudy怎么運(yùn)行thinkphp?
安裝phpstudy后,運(yùn)行軟件。首先,將TP程序放到一個(gè)web目錄uthinkphp(可定制)openphpstudy中,右邊有一個(gè)PHP版本。在其他選項(xiàng)菜單中選擇TP所需的版本(tp3.2,5.3~5.4優(yōu)先,TP5,5.5可選)->打開(kāi)主機(jī)->添加一行域名1127.0.0.1tp.me公司保存(如果您沒(méi)有修改權(quán)限,可以在桌面上創(chuàng)建一個(gè)文件,添加上面的代碼行,然后覆蓋到主機(jī)所在的目錄)在其他選項(xiàng)菜單->站點(diǎn)域名管理->域名:tp.me公司路徑:to the webuthinkphp第二域名:empty port:80[add]->保存并生成配置文件,然后在瀏覽器中輸入tp.me公司運(yùn)行TP
ThinkPHP重定向方法可以實(shí)現(xiàn)頁(yè)面重定向(跳轉(zhuǎn))功能。
重定向方法的語(yǔ)法如下:
$this->redirect(string URL,array params,int delay,string MSG)
參數(shù)說(shuō)明:
Parameter
Description
URL
必須是重定向的URL表達(dá)式。
Params
可選,其他URL參數(shù)。
Delay
可選,重定向延遲,以秒為單位。
MSG
可選,重定向提示信息。
ThinkPHP redirect instance
在index模塊的index方法中,重定向到該模塊的select操作:
class indexaction extends action{
public function index(){
$this->redirect(“select”,array(“status”=>1),3,“page Jump~”)
]}//直接重定向,不帶延遲
$this->redirect(“select”,array(“status”=>1))
//延遲跳轉(zhuǎn),但不帶參數(shù),輸出默認(rèn)提示
$this->redirect(“select”,“,3) ]//重定向到其他模塊操作
$this->redirect(“public/login”)//重定向到其他組
$this->redirect(“admin public/login”)