du90093662774150 2014-05-02 17:20
浏览 19

从SQL Db获取用户信息以强制执行新登录

I have the following sites:
triplestrata.com
ooo.triplestrata.com <- not actual name.

The former is a static HTML website with some JavaScript and the latter is based on WordPress.

On the WP site in the subdomain, there are page that can only be viewed by registration. To control that, i have a plugin that will block access to restricted pages and lead them to register.

By registering, users get the access to the said areas along with their credentials (user name and password).

On the restricted areas there are some links that lead back to the main site (triplestrata.com), but I wanted people to login once more in order to view them.

People with the link would have to enter their credentials once more and, in case they were not members, they are lead to a 401 page requesting them to register.

This can be easily accomplished on cPanel by password protect the directory containing the member's only files and adding an user along with his/her password.

The problem is that such method is manual, which means that every time a new user registers, I have to go back to the SQL Db to get his/her info and add the new user to have access...

So, my question is: how to make it possible for when a new user registers on the subdomain and gets his credentials added to the SQL database, that information is retrieved from the Db and added automatically to the .htaccess file or whatever that information is stored and when he visits the pages on the static HTML site, he's prompted to login again?

In other words, how to automatically add new user information to .htaccess? Is there a script one could use? I'm sorry for bothering. Thank you.

EDIT If I converted the HTML site to PHP how should I proceed from there? Would it be easier to set this up?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法
    • ¥15 matlab代码代写,需写出详细代码,代价私
    • ¥15 ROS系统搭建请教(跨境电商用途)
    • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。