【发布时间】:2012-09-19 09:01:43
【问题描述】:
我正在使用 WAMP 并在本地托管 PHP 文件。
假设我有这两个文件。
customer.php- 添加客户详细信息的表单
recordCustomer.php- 连接到数据库并将信息存储在数据库中(所有处理完成的地方)
如何通过在地址栏中输入文件名来阻止用户访问文件 recordCustomer.php。
http://localhost/testing/recordCustomer.php has to be redirected and given an error message
然而
http://localhost/testing/customer.php is allowed
谢谢
【问题讨论】:
-
您的用户是否登录到您的页面?那你用会话吗?
-
是的。系统有不同的用户级别,用户需要登录。如果尝试访问完成数据处理的文件,我只需要给他们一条错误消息。