gpt4 book ai didi

php - mysql服务器、用户名和密码在php网站上是公开的吗? (mysql_连接)

转载 作者:行者123 更新时间:2023-11-29 13:12:05 25 4
gpt4 key购买 nike

如果我的网站上有一个像这样的 php 脚本:

<?php
mysql_connect("server","username","password");
mysql_select_db("commentbox");
$name=strip_tags($_POST['name']);
$comment=strip_tags($_POST['comment']);
$submit=strip_tags($_POST['submit']);
?>

将“mysql_connect(“服务器”,“用户名”,“密码”);”向所有查看该网页上的源代码的人公开吗?

最佳答案

如果您的意思是“查看源代码”,使用浏览器的“查看源代码”功能,那么不行。只要您的服务器配置为运行 PHP,外部世界就永远看不到代码,只能看到运行脚本的输出。

关于php - mysql服务器、用户名和密码在php网站上是公开的吗? (mysql_连接),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21961547/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com