vantrung
Aug 11 2009, 01:46 PM
I make login page. When I click submit to occur a error : "Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'http' (1) in /www/vndv.com/b/e/n/benninhkieu/htdocs/logintest/loginproc.php on line 9 ".
It can not transfer to check username & password.
My site : benninhkieu
database name : benninhkieu_dl
table name : tbuser
files uploaded in folder: logintest
Please show me :where's wrong on my code :
<?
session_start();
$server = "http://www.benninhkieu.vndv.com";
$username = "root";
$password = "";
$db_name = "benninhkieu_dl";
$db = mysql_connect($server,$username,$password) or DIE("Connection to database failed, perhaps the service is down !!");
mysql_select_db($db_name) or DIE("Database name not available !!");
$login = mysql_query("select * from tbuser where (username = '" . $_POST['username'] . "') and (password = '" . md5($_POST['password']) . "')",$db);
$rowcount = mysql_num_rows($login);
if ($rowcount == 1) {
$_SESSION['username'] = $_POST['username'];
header("Location: securedpage.php");
}
else
{
header("Location: loginpage.php");
}
?>
THANKS!
The host (in your case $server) should be 'localhost'.
Ayurne
Aug 13 2009, 08:49 PM
hey i got the same problem i get this error
Fatal error: Call to undefined function mssql_connect() in /www/vndv.com/c/r/u/cruel-gunz/htdocs/config.php on line 32
i want to host my GunzDatabase but i dont know how
this is my config:
<?
@session_start();
//MSSQL Server configuration
$_MSSQL[Host] = "http://cruel-gunz.vndv.com";
$_MSSQL[User] = "cruel-gunz_cg";
$_MSSQL[Pass] = "password";
$_MSSQL[DBNa] = "cruel-gunz_cg";
//MySQL Server configuration
$_MYSQL[Host] = "localhost";
$_MYSQL[User] = "cruel-gunz_cg";
$_MYSQL[Pass] = "Pasword";
$_MYSQL[DBNa] = "cruel-gunz_cg";
//Configuration
$_CONFIG[NewsFID] = 2;
$_CONFIG[EventsFID] = 0;
$_CONFIG[vBulletinPrefix] = "xxxxx";
$_CONFIG[ForumURL] = "http://www.forum-cg.vndv.com/";
//Offline page
$_CONFIG[OfflinePage] = "";
$r = mssql_connect($_MSSQL[Host], $_MSSQL[User], $_MSSQL[Pass]) or die("Cant connect to database");
mssql_select_db($_MSSQL[DBNa], $r);
?>
where did i wrong
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.