静态网页制作——在phpsrorm中怎么样搭建在线留言网页

本文将指导你如何在PHPStorm环境中利用ThinkPHP5(TP5)框架搭建一个在线留言网页。首先,我们将创建`message.php`控制器文件,接着创建`message.html`视图文件来展示留言内容。同时,还会介绍如何在页面中添加图片以增强用户体验。最后,将解释如何正确加载页面,确保留言功能正常运行。
摘要由CSDN通过智能技术生成
搭建tp环境:
1.解压"tp5"压缩包到"thinkphp_5.0.24_with_extend\"(E);
2.把解压好的"tp5文件夹"—>改名"owz(可以起其它的名字)"->把owz文件夹拷贝到WWW目录;
3.在浏览器中输入"http://127.0.0.1/owz/public"—>查看tp5是否可以使用;
4.把"message.html"——>放在新建的"view文件夹“下的"Message文件夹”中;
5.owz\application\index\controller——>创建Message.php文件
内容:
<?php
namespace app\index\controller;
use think\Controller;
class Message extends Controller
{
    public function index()
    {
      return $this->fetch('message');
    }
}
显示bug:
6.owz\application\config.php——>// 应用调试模式——>'app_debug'     => false,——>修改成'app_debug'     => true,

怎么在phpstorm中打开一个新窗口:
7.File——>Open Recent——>选择要打开的文件夹名;
********************************************************************************************************************
模块不存在:message(bug)

http://www.iheyu.com/owz/public/index.php/message
改成:
没有样式和图片的页面
http://www.iheyu.com/owz/public/index.php/index/message
******************************************************************************************************************
8.C:\phpStudy\PHPTutorial\WWW\owz\application\index\controller\Message.php
测试 修改内容:
public function index()
    {
//      return $this->fetch('message');
      return "112233";  //通过message跳转到页面
    }
http://www.iheyu.com/owz/public/index.php/index/message
页面显示"112233";

9.把解压后文件夹中的"css、images、js文件夹和blank.gif文件——>放在C:\phpStudy\PHPTutorial\WWW\owz\public\static
中新创建的index文件夹中;

http://www.iheyu.com/owz/public/static/index/images/logo.jpg
***********************************************************************************************************************
模块不存在:static(bug)

http://www.iheyu.com/owz/public/static/index/images/logo.jpg
就可以看到要插入的一张图片

10.C:\phpStudy\PHPTutorial\WWW\owz\application\index\view\Message\message.html

修改图片路径
例如:
原内容:<img src="images/top.jpg" width="42" height="12" />
修改为:<img src="/owz/public/static/index/images/top.jpg" width="42" height="12" />
*********************************************************************

原内容:
	
<body>
  <div class="top"> 
    <div class="top1"> 
       <div class="top1a"><a href="index.html" target="_top" name="top"><img src="images/logo.jpg" width="202" height="79" /></a></div>
       <div class="top1b"> 
          <div class="top1b1"><input type="text" value="请输入关键词" /></div>
          <div class="top1b2"><a href="#"><img src="images/bt.jpg" width="27" height="23" /></a></div>
       </div>
       <div class="top1c"> 
         <ul> 
           <li style="width:56px;"><a href="index.html" target="_top">首页</a></li>
           <li><a href="company.html" target="_top">企业中心</a>&
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值