域名 phpstudy怎么運行thinkphp?
phpstudy怎么運行thinkphp?安裝phpstudy后,運行軟件。首先,將TP程序放到一個web目錄uthinkphp(可定制)openphpstudy中,右邊有一個PHP版本。在其他選項菜
phpstudy怎么運行thinkphp?
安裝phpstudy后,運行軟件。首先,將TP程序放到一個web目錄uthinkphp(可定制)openphpstudy中,右邊有一個PHP版本。在其他選項菜單中選擇TP所需的版本(tp3.2,5.3~5.4優(yōu)先,TP5,5.5可選)->打開主機->添加一行域名1127.0.0.1tp.me公司保存(如果您沒有修改權(quán)限,可以在桌面上創(chuàng)建一個文件,添加上面的代碼行,然后覆蓋到主機所在的目錄)在其他選項菜單->站點域名管理->域名:tp.me公司路徑:to the webuthinkphp第二域名:empty port:80[add]->保存并生成配置文件,然后在瀏覽器中輸入tp.me公司運行TP
ThinkPHP重定向方法可以實現(xiàn)頁面重定向(跳轉(zhuǎn))功能。
重定向方法的語法如下:
$this->redirect(string URL,array params,int delay,string MSG)
參數(shù)說明:
Parameter
Description
URL
必須是重定向的URL表達式。
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”)