简体   繁体   English

如何将php中的注册登录脚本链接到我的html文件?

[英]How to link register-login script in php to my html file?

I have a login-register script forked from here - https://github.com/panique/php-login-minimal 我有一个从此处派生的登录注册脚本 -https: //github.com/panique/php-login-minimal

I have my website coded in bootstrap as a css framework and everything is in html . 我的网站在bootstrap中编码为css框架,并且所有内容都在html中 My index file is also html. 我的索引文件也是html。 Also I have a Popup-Login snippet from over here - http://bootsnipp.com/snippets/featured/sign-in-sign-up-dual-modal 我也从这里获得弹出式登录代码段-http : //bootsnipp.com/snippets/featured/sign-in-sign-up-dual-modal

Now if I want to include php files into html it is considered as a bad practice and moreover Netbeans(IDE) doesn't allow you to write php code into html once you have created a HTML project . 现在,如果我想将php文件包含到html中,则认为这是一种不好的做法,而且一旦创建HTML项目, Netbeans(IDE)不允许您将php代码写入html。 Edit :Do I need to have my index file containing the form in php to get this working? 编辑 :我需要让我的索引文件包含php中的表格才能正常工作吗?

How should I proceed? 我应该如何进行? How should I link the php stuff to my popup form fields and get this combination to work? 我应该如何将php内容链接到我的弹出表单字段 ,并使这种组合起作用? I was unable to find any answers on the net anywhere. 我无法在网上找到任何答案。

By default .html files are treated as static, and so the PHP code inside will not get executed. 默认情况下, .html文件被视为静态文件,因此不会执行其中的PHP代码。 Moreover, it will be visible in the source of a page (when you click View->Source). 而且,它在页面的源中将是可见的(单击“视图”->“源”时)。 It must not what you want to do ;) 它一定不是你想做的;)

I suggest you write a separate .php file with your PHP code, and then include the HTML code where you need it. 建议您用PHP代码编写一个单独的.php文件,然后在需要的地方包含HTML代码。 Not the other way around! 并非相反!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM