如何创建install.php,包括步骤如购物车 [英] How to create install.php including steps like a shopping cart

查看:153
本文介绍了如何创建install.php,包括步骤如购物车的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的小cms创建一个install.php,但我有很多问题。

I would like to create an install.php for my tiny cms but i have a lot of questions.

如何在索引之前显示install.php。 php?

- 我想创建步骤,就像在购物车。步骤是:

     step1:(你准备好了吗?-submit-)

     if step1已完成 - > step2:form(database-host-user-pass) - >保存config.php并创建表

    如果step2完成 - > step3 :(admin用户名,管理员密码,页面标题) - >插入管理员

    如果step3完成 - > step4:install.php删除自己。 >
- 有可能用一个文件吗?

-How to display install.php before the index.php?
-I would like to create steps, like in a shopping cart. The steps are:
    step1: (hi! are you ready? -submit-)
    if step1 is completed->step2:form(database-host-user-pass)->saves config.php and creates the tables
    if step2 is completed->step3:(admin username,admin pass,page title)->insert into admin
    if step3 is completed->step4:the install.php deletes itself.
-Is it possible to do it with one file?

我有一个文件中的步骤的大部分代码,最后一个问题是,如何创建步骤。
我必须用会话或某些id来做某事吗?如何?

I have most of the code of the steps in a file, the last question is, how to create steps.
Do i have to do something with session or with some id-s? How to?

推荐答案

有很多方法可以做到这一点。

There are plenty of ways you could do this.


  1. 为什么不将 install.php 重命名为 index.php 然后将 index.php 重命名为 begin.php

  1. Why not rename install.php to index.php and then rename index.php to something like begin.php

然后在您的 begin.php 页面上,您可以执行一系列div,并且一次只显示其中一个。当您单击下一步按钮时,div1将消失,并且将显示div2。等等等等。我做了一个jsfiddle,表明了这一点: http://jsfiddle.net/vVsAn/2110/ 请注意,这假设您已安装jquery。

And then on your begin.php page you could do a series of divs and only display one of them at a time. When you click the "next" button, div1 would disappear, and div2 would appear. And so on and so forth. I made a jsfiddle that kind of demonstrates this: http://jsfiddle.net/vVsAn/2110/ Note that this assumes you have jquery installed.

而不是删除 install.php (现在是 index.php ),你可以在 index.php 的顶部添加一个支票像这样的事情

Instead of deleting install.php (which is now index.php) you would put a check at the top of index.php that goes something like this

if(installed == true){
//显示内容
} else {
//显示安装程序divs
}

这篇关于如何创建install.php,包括步骤如购物车的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆