Page 1 of 2

Codes?

Posted: Wed Mar 31, 2010 4:03 pm
by mikecheer101
where are the codes for urban realms?

Re: Codes?

Posted: Wed Mar 31, 2010 4:13 pm
by mikecheer101
lol i found it.
it was with the download lol.

Re: Codes?

Posted: Wed Mar 31, 2010 4:37 pm
by mikecheer101
i dont know why but when i click register i get an error
heres the code

Code: Select all

<?php
parse_str("$QUERY_STRING");

$db = mysql_connect("localhost", "root", "NEWPASSWORD") or die("Could not connect.");
if(!$db) 
	die("no db");
if(!mysql_select_db("urbanrealms",$db))
 	die("No database selected."); 
if(!get_magic_quotes_gpc())
{
  $_GET = array_map('mysql_real_escape_string', $_GET); 
  $_POST = array_map('mysql_real_escape_string', $_POST); 
  $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
else
{  
   $_GET = array_map('stripslashes', $_GET); 
   $_POST = array_map('stripslashes', $_POST); 
   $_COOKIE = array_map('stripslashes', $_COOKIE);
   $_GET = array_map('mysql_real_escape_string', $_GET); 
   $_POST = array_map('mysql_real_escape_string', $_POST); 
   $_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
}
?> 


heres the error

Notice: Undefined variable: QUERY_STRING in C:\wamp\www\urban\connect.php on line 2

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\urban\connect.php on line 4
Could not connect.

Re: Codes?

Posted: Wed Mar 31, 2010 5:09 pm
by hallsofvallhalla
change the password from 'NEWPASSWORD' to '' in other words deleete the password if you never set one up in wamp.

Re: Codes?

Posted: Wed Mar 31, 2010 5:17 pm
by mikecheer101
Thank You! :D

Re: Codes?

Posted: Wed Mar 31, 2010 5:42 pm
by mikecheer101
i still have this error


Notice: Undefined variable: QUERY_STRING in C:\wamp\www\urban\connect.php on line 2

Re: Codes?

Posted: Wed Mar 31, 2010 5:56 pm
by hallsofvallhalla
delete this line

Code: Select all

parse_str("$QUERY_STRING");
i am uploading fixed code within the next five minutes. I had to make the code compatible to all environments. It works on half and doesnt on the other half due to different systems...go figure..anyways uploading the fixed code now :)

Re: Codes?

Posted: Wed Mar 31, 2010 6:07 pm
by mikecheer101
k thanks :D

Re: Codes?

Posted: Wed Mar 31, 2010 7:51 pm
by mikecheer101
now i have errors saying
Notice: Undefined index: shid in C:\wamp\www\urban\index.php on line 373
Notice: Undefined index: pid in C:\wamp\www\urban\index.php on line 374
Notice: Undefined variable: bypassmap in C:\wamp\www\urban\index.php on line 363
Notice: Undefined index: pclass in C:\wamp\www\urban\statpanel.php on line 7

Re: Codes?

Posted: Wed Mar 31, 2010 7:53 pm
by Noctrine
Those aren't errors, they are notices.

Its what happens when you don't check if a variable exists before trying to call it. Bad in the sense that they expose information about how the site runs (not totally valuable information but information nonetheless)

You can hide them by not setting the error reporting to E_ALL

or you can fix the problem by doing an isset check before assigning a variable.