Home > Backend Development > PHP Tutorial > [PHP Development] Defining the core controller for building a shopping website

[PHP Development] Defining the core controller for building a shopping website

little bottle
Release: 2023-04-06 07:12:02
forward
2128 people have browsed it

The main content of this article is to build the definition core controller of a shopping website. Friends who are interested can learn about it.

Method to implement jump:

1.Header function in Php

2Location function in js

3.Meta function in Html

Introduce message.html

<meta http-equiv="Refresh" content ="<?php echo $wait;?> ;url=<?php echo $url;?>"/>
<link href="application/views/admin/styles/general.css" rel="stylesheet" type="text/css" />
<link href="application/views/admin/styles/main.css" rel="stylesheet" type="text/css" />
<td style="font-size: 14px; font-weight: bold"><?php echo $message;?></td>
</tr>
<tr>
<td></td>
<td id="redirectionMsg">
<?php echo $wait;?> 秒之后跳转
</td>
</tr>
<tr>
<td></td>
<td>
<ul style="margin:0; padding:0 10px" class="msg-link"> 
<li><a href=""></a></li>
</ul>
</td>
</tr>
</table>
</div>
</div>
Copy after login

Establish a basic control class

<?php
class Controller{
   //跳转方法
   public  function jump($url,$message,$wait=3){
       if($wait==0){

           header("Location:$url");

       }else{

           include CUR_VIEW_PATH."message.html";
       }

       exit();//一定要退出die一样。

   }

}

?>
Copy after login

Related tutorials: PHP video tutorial

The above is the detailed content of [PHP Development] Defining the core controller for building a shopping website. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template