I want to create simple CMS that would allow editing the site in place (inline editing).
我想创建简单的CMS,允许在适当的位置编辑网站(内联编辑)。
What I've done:
我做了什么:
- Login panel on PHP and MySQL
- Editing page with inline editor BootStrap WyswiHTML5
- Fully working saving and reading from MySQL via WyswiHTML5
PHP和MySQL上的登录面板
使用内联编辑器编辑页面BootStrap WyswiHTML5
通过WyswiHTML5完全保存并从MySQL读取
But, now we have a site that is only read tables from MySQL for normal user. And the second is mirror site first with added BootStrap WyswiHTML5, where Admin can change content of site first.
但是,现在我们有一个只为普通用户从MySQL读取表的站点。第二个是镜像站点,首先添加了BootStrap WyswiHTML5,管理员可以先更改站点内容。
So it very annoyingly that I must have mirrored site... I have idea that if we go to url: http://example.com/admin, we have a login forms. If password is correct then redirect us to the first (and only one) page, but with some value.
所以我必须拥有镜像网站非常烦人...我知道如果我们去网址:http://example.com/admin,我们有一个登录表单。如果密码正确,则将我们重定向到第一个(也是唯一一个)页面,但具有一定的价值。
On this site will be a if function and if we logged then editor are enabled.
在这个站点上将是一个if函数,如果我们登录,则启用编辑器。
It's simple to write here that, but i have no idea how to do that. Maybe more experienced members of * could help me.
这里写的很简单,但我不知道该怎么做。也许更有经验的*成员可以帮助我。
1 个解决方案
#1
0
Why not implement a login check with PHP ?
为什么不用PHP实现登录检查?
Save the login-state in the PHP $_SESSION variable after login.
登录后将登录状态保存在PHP $ _SESSION变量中。
Check this variable on the regular website. If an Admin is logged in you could just print out the HTML code for your wysiwyg, make an page redirect, or whatever you prefer.
在常规网站上查看此变量。如果管理员已登录,您可以打印出所见即所得的HTML代码,进行页面重定向或任何您喜欢的内容。
Read this: http://www.php.net/manual/en/function.session-start.php
请阅读:http://www.php.net/manual/en/function.session-start.php
#1
0
Why not implement a login check with PHP ?
为什么不用PHP实现登录检查?
Save the login-state in the PHP $_SESSION variable after login.
登录后将登录状态保存在PHP $ _SESSION变量中。
Check this variable on the regular website. If an Admin is logged in you could just print out the HTML code for your wysiwyg, make an page redirect, or whatever you prefer.
在常规网站上查看此变量。如果管理员已登录,您可以打印出所见即所得的HTML代码,进行页面重定向或任何您喜欢的内容。
Read this: http://www.php.net/manual/en/function.session-start.php
请阅读:http://www.php.net/manual/en/function.session-start.php