如何为php连接字符串创建xml文件 [英] How to Create xml file for php connection string

查看:46
本文介绍了如何为php连接字符串创建xml文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php

$iterations = 3;
$hash = crypt($password,$salt);
for ($i = 0; $i < $iterations; ++$i)
{
    $hash = crypt($hash . $password,$salt);
	echo $hash;
}


?>

我是新手,对开发Web应用程序的经验较少.
是在php和Mysql数据库服务器中作为后端构建一个非常敏感的应用程序.
但是,尤其是在我的登录页面以及应用程序中的任何页面上,我都直接在代码中使用到数据库服务器的连接字符串.毫无疑问,这是一个安全漏洞.
在ASP.NET中使用webconfig,我想创建一个xml文件来保存我的连接字符串,我将从应用程序中读取它.
我做了足够的谷歌,没有任何希望.请给我看一个样品.
上面的代码是我的Authentication.php,但是我不想直接将连接字符串编码为db.只是为了.
谢谢

I am new gradual with less experience in Developing web appli cation.
Am a building a very sensitive application in php and Mysql database server as the back end.
But in my login page in particular and any page in my application i use the connection string to my database server directly in my code. No doubt this is a security hole.
In ASP.NET The webconfig is use, i want to create and xml file to save my connection string there i would be reading it from my application.
I did enough google to no vail. pls show me a sample.
The code above is my Authentication.php but i don''t want to code the connection string to db directly. Just to reff.
Thanks

推荐答案

迭代 = 3 ;
iterations = 3;


哈希 = crypt(
hash = crypt(


密码,


这篇关于如何为php连接字符串创建xml文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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