php - 无法使用我的托管登录页面登录

标签 php mysql phpmyadmin

我正在尝试在托管网站 www.my3gb.com 中托管我的代码 我的代码在我的电脑上运行良好,但当我在那里托管时却无法运行......看看这段代码......

<html>
<body bgcolor="green">

<?php
$conn=mysql_connect("http://www.my3gb.com/phpmyadmin/","username","password");
mysql_select_db("mohit007kumar00_cboy",$conn);
print "<h1>connected</h1>";
$rs=mysql_query("select * from signup where user='".$_POST['t1']."'");
print "<h1>queried</h1>";
while($row=mysql_fetch_array($rs))
{
    print "<h1>under while</h1>";
    if($row['pswd']==$_POST['t2'])
    {
        print "<h1>You are alowed</h1>";
    }
    else
    {
        print "<h1>not alowed</h1>";
    }
}
?>
</body>
</html>

登录页面是......

    <html>
    <body bgcolor="yellow">
    <center>
    <h1>Login Application</h1>
    <form action="log.php" method="post">
    user<input type="text" name="t1"><br><br>
    pswd<input type="password" name="t2"><br><br>
    <input type="submit">
    </form>
    </center>
    </body>
 </html>

在我的电脑上它会显示这样的输出...... 连接的 询问 一会儿 你被允许 在我的托管链接上,它将显示这样的输出...... 连接的 询问 您可以在这里查看我的登录页面 http://mohit007kumar00.my3gb.com/test.php

最佳答案

我认为问题出在这里:

mysql_connect("http://www.my3gb.com/phpmyadmin/","username","password");

尝试

mysql_connect("localhost","username","password");

我认为 MySQL 不会连接到托管的 phpMyAdmin,但也许这是我的误解。

关于php - 无法使用我的托管登录页面登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5458637/

相关文章:

php - 如何让 PHP bool 值 FALSE 仅输出为 FALSE

php - 经销商定位器 mysql 和 php 的关系模式

MySQL 在 select distinct 和 count 中更改标签值

mysql - 使用其他表中的值之和更新 sql 表中的记录

mysql - 如何加密整个列

mysql - 如何停止phpMyAdmin服务器监控?

PHP 获取两行但仅从最后一行上传文件

php - 如何手动创建 laravel 迁移文件

php - 如何在 php mysql 查询中使用数组?

php - 使用谷歌云存储/bigdata作为php应用程序的mysql数据库