为多个域使用单个数据库连接脚本 [英] Using a single database connection script for multiple domains

查看:53
本文介绍了为多个域使用单个数据库连接脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,周日快乐。 :)


任何人都可以建议,如果单个域使用单个数据库类,1个子域是正确的方法吗?我有:


mydomain.com(和)

sub.mydomain.com


我想要使用单个脚本连接到数据库。这是可取的吗?子域是私有方,域是公共方。


谢谢,


Frank

Hello everyone and happy Sunday. :)

Can anyone advise if using a single database class for a single domain and 1 subdomain is the correct way to go? I have:

mydomain.com (and)
sub.mydomain.com

I would like to use a single script to connect to the database. Is this advisable? The subdomain is the private side and the domain is the public side.

Thanks,

Frank

推荐答案

bump。


应该开始一个新帖子......我正在失去理智。 :)
bump.

Should have started a new post.. I''m losing my mind. :)


我猜你的网页受到某种程度的保护?


如果你不这样做只是要求你使用include语句?在页面安全性之后使用它意味着在能够看到该页面之前必须通过访问控制
im guessing that your pages are protected in some way?

if you do wouldn''t it just require you to use the include statement? using it after the page security would mean access control would have to be passed before being able to see that page


您能告诉我们更多关于您的公共方面和私人方面的信息。基本上你的域和子域是否可用于公共访问权限?换句话说,任何人都可以访问 http://sub.yourdomain.com 。 ?


一般来说,子域名只不过是另一个在public_html目录中的目录(我在谈论linux上的apache)。如果你真的想把你的安全文件放在public_html文件夹的旁边,你可以将它们存储在服务器的顶层。那么公共用户或程序就无法访问这些文件。但Php-Engine将能够读取服务器上的顶级目录。


-Thanks
Could you please tell us more on your public side and private side. basically your domain and subdomain is available for public access right? In other words can anyone access http://sub.yourdomain.com. ?

In generally subdomain is nothing but its again another dir in public_html dir (I''m talking about apache on linux). if you really want to put your secure files out side the public_html folder, you can store them in a top level derectory of your server. then public users or programs can''t access those files. but Php-Engine will be able to read the top level dir s on the server.

-Thanks


这篇关于为多个域使用单个数据库连接脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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