• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[help]boi website

Newbie Spellweaver
Joined
Nov 10, 2013
Messages
81
Reaction score
27
Hello all!!

Can someone look into my website files and see what is wrong?:?::?:
Because the website don't get the account from SQL DB(windows) and MySql DB(CentOS) information.
[IMG]https://forum.ragezone.com/ima...ire.com/download/xg7iar6n6osfq60/Help+pls.rar
 
Newbie Spellweaver
Joined
Nov 10, 2013
Messages
81
Reaction score
27
ok my problem could be here because i don't understand this part...

mysql_connect is for mysql db

and

("$mssql_host", "$mssql_user", "$mssql_pass") for mmsql no?



the PassportBOI db need to be on CentOS in mysql or in windows mssql?


and $tbl_name="account"; // Table name account from PassportBOI db?

<?php

$mssql_host="192.168.2.107"; // Host name
$mssql_user="sa"; // Mysql username
$mssql_pass="123456"; // Mysql password
$mssql_db="PassportBOI"; // Database name
$tbl_name="login"; // Table name

// Connect to server and select database.
mysql_connect("$mssql_host", "$mssql_user", "$mssql_pass")or
die("cannot connect");
mysql_select_db("$mssql_db")or die("cannot select DB");

// username and password sent from form
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];

// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);

//$sql="SELECT * FROM account2 WHERE name='$myusername' and passwd='$mypassword'";
//$result = mssql_query($sql) or die(mysql_error());
//$count=mssql_num_rows($result);
//echo $count;

$sql ="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result = mysql_query($sql) or die;
$row=mysql_fetch_array($result);
$active=$row['active'];
$count=mysql_num_rows($result);

if($count==1)
{
session_register("myusername"); //If matches creates session!
$_SESSION['myusername']=$_POST["myusername"];

if (isset($_POST['rememberme'])) {
/* Set cookie to last 1 year */
setcookie('myusername', $_POST['myusername'], mktime(23, 59, 59, date("m"), date("d"), date("y")), '/account', 'rageboi');
setcookie('mypassword', md5($_POST['mypassword']), mktime(23, 59, 59, date("m"), date("d"), date("y")), '/account', 'rageboi');

} else {
/* Cookie expires when browser closes */
setcookie('myusername', $_POST['myusername'], false, '/account', 'rageboi');
setcookie('mypassword', md5($_POST['mypassword']), false, '/account', 'rageboi');
}

header('Location: index2.php?id=home'); //Will lead to index.php!

}

else {

echo '<script type="text/javascript">alert("Wrong username or password!");</script>';
header('Location: index2.php?id=main_login'); //Will lead to index.php!

}

?>
 
Back
Top