Connection between Database & Website *FIXED*

Status
Not open for further replies.
Re: Connection between Database & Website

mssql_connect("shorty\SQLEXPRESS","sa","18164230");

Way to give the entire world your DB username/password - now, if anyone knows the link to your server, assuming MSSQL is enabled for remote access...

Also:

Code:
function antisql($sql)
{
// Remove words that contain SQL syntax
$sql = preg_replace(sql_regcase("/(from|update|set|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql); //Replaces some parts of a SQL query with absolutely nothing.
$sql = trim($sql); //antisqls up spaces
$sql = strip_tags($sql);//Php and html tags strip
$sql = addslashes($sql);//Adds backslashes to one string
return $sql;
}

Terrible sanitization function - as suggested before, just escape backslashes, single quotes, and double quotes. Or, even better, grab all a-z, A-Z, and 0-9 characters:

function sanitize_data ( $query ) {
return preg_replace( "/[^a-zA-Z0-9 ]/i", "", $query );
}


mssql_query("UPDATE Login SET Allowed = '1' WHERE UserID = '".$data['User']."'");

Anyways, maybe you should state the problem you're experiencing?
 
Upvote 0
Re: Connection between Database & Website

That is not my servername & password. I edited that before i posted. :P

The problem is that when people are on my server, it say's there are 0 people online,
whenever I login as ugrade 252,254,255 it says "wrong username or password", when im ugradeid 0,
it says you are already logged in.
I fixed the ranking, (thanks shadow-xx for your ranking page.)
(I don't know left from right on php)
 
Upvote 0
Re: Connection between Database & Website

That is not my servername & password. I edited that before i posted. :P

The problem is that when people are on my server, it say's there are 0 people online,
whenever I login as ugrade 252,254,255 it says "wrong username or password", when im ugradeid 0,
it says you are already logged in.
I fixed the ranking, (thanks shadow-xx for your ranking page.)
(I don't know left from right on php)

The page you've shown us..

if(mssql_num_rows($res) >= 1){
$data = mssql_fetch_assoc($res);
mssql_query("UPDATE Login SET Allowed = '1' WHERE UserID = '".$data['User']."'");
mssql_query("UPDATE SessionHash SET Used = '1' WHERE HashString = '$hashid'");
echo "YES";
}else{
echo "NO";
}

..compares session ID, and if it finds the session is valid, it'll modify a few columns.

Sounds like you're giving us the wrong page
 
Upvote 0
Re: Connection between Database & Website

mod_iLogin.php *the login*
Code:
<?
if ($_SESSION['AID'] == ""){
?>
<div align="center">
						<table border="0" style="border-collapse: collapse" width="195" id="table5">
							<tr>
								<td background="http://forum.ragezone.com/images/account.jpg" height="30" width="195"> </td>
							</tr>
							<tr>
								<td background="http://forum.ragezone.com/images/menu_bg.jpg">
								<form method="POST" action="index.php?do=login&header=1" name="login">
									<table border="0" style="border-collapse: collapse" width="193" height="100%" id="table10" class="iLogin">

										<tr>
											<td width="191" colspan="4"> </td>
										</tr>
										<tr>
											<td width="4"> </td>
											<td width="111">
											<input type="text" name="userid" size="14" style="background-image: url('images/usernamebg.jpg'); background-position: left center" class="login"></td>
											<td width="62" rowspan="2">
											<p align="center">

											<input type="submit" value="Login" name="submit"></td>
											<td width="8" rowspan="2"> 
											</td>
										</tr>
										<tr>
											<td width="4"> </td>
											<td width="111">
											<input type="password" name="pasw" size="14" style="background-image: url('images/passwordbg.jpg'); background-position: left center" class="login" id="input"></td>
										</tr>

										<tr>
											<td width="4"> </td>
											<td width="175" colspan="2">
											<input type="checkbox" name="cookie" value="ON" checked>Log me in automatically</td>
											<td width="8"> 
											</td>
										</tr>
										<tr>

											<td width="4"> </td>
											<td width="175" colspan="2" bgcolor="#1A1A1A"> 
											</td>
											<td width="8"> 
											</td>
										</tr>
										<tr>
											<td width="4"> </td>
											<td width="175" colspan="2" bgcolor="#1A1A1A">

											<span style="font-size: 7pt"> 
 
Upvote 0
Re: Connection between Database & Website

I'm really sorry for double posting, this has been bugging me for a few.

I can't login at all, it say's "Wrong Username or Password."

I have tried AppServ, Wamp, Xamp, currentley using Wamp. I am using the Unbugged MPOG website,
and I am using Br Jan/Jun Client & Server by MaxTraxv3 client.

P.S: I have tried Kochon's fix, still didn't work.

Edit: I tried registering, dosen't send anything to the database. T_T
 
Upvote 0
Re: Connection between Database & Website

Server files wouldn't be the problem.
There's most likely just a Bug in the Site. I have never used the MPOG site because of its errors and bugs. Just use a different site.
 
Upvote 0
Status
Not open for further replies.
Back