- <?
-
- error_reporting(0);
-
- session_start();
-
-
-
- date_default_timezone_set("Europe/Copenhagen");
-
- $server = "XXXXXXXX";
- $server2 = "XXXXXXXX";
-
- $serverbruger="XXXXX";
- $serverbruger2="XXX";
-
- $serverpass="XXX";
-
-
-
- function verificer_ugylding_tegn($string){
- $find = array("&",
- "\\",
- "!",
- "=",
- "/",
- "<",
- ">",
- "'"); //'
- $erstattet = str_replace($find, "", $string);
- return $erstattet;
- }
-
-
- $db2=@mysql_connect($server2,$serverbruger2,$serverpass)or die(mysql_error());
- mysql_select_db($serverbruger2,$db2);
-
- if($db = @mysql_connect($server,$serverbruger,$serverpass))
- mysql_select_db($serverbruger,$db);
-
- //This stops SQL Injection in POST vars
- foreach ($_POST as $key => $value) {
- if(is_string($value)){
- if(get_magic_quotes_gpc())
- $value = stripslashes($value);
- $_POST[$key] = mysql_real_escape_string($value);
- }
- }
-
- //This stops SQL Injection in GET vars
- foreach ($_GET as $key => $value) {
- if(is_string($value)){
- if(get_magic_quotes_gpc())
- $value = stripslashes($value);
- $_GET[$key] = mysql_real_escape_string($value);
- }
- }
-
-
- //Hvis DB går ned
- if(!$foedselsdagsforesp = @mysql_query("SELECT brugerlogin,fdag,id FROM gaester WHERE visfdag!='0' AND blokeret!='1'")){
- require('/Inkluder/viderestilles.htm');//Send da en header...
- exit;
- }
-
- //Direkte brugerprofil visning via subdomæne
- if(ereg("(www.)?([0-9a-z_\æ\ø\å ()!]+)\.()$",$_SERVER['HTTP_HOST'],$regs)){
-
- if($regs[2]!="www"){
- $brugerSide = "";
-
- $foresp=mysql_query("SELECT id FROM gaester WHERE brugerlogin='$regs[2]'");
-
- if($data=mysql_fetch_row($foresp)){
- $brugerSide = "http://$regs[3]/Brugere/visbrugerprofil.php?bruger=$data[0]";
- }else{
-
- $foresp=mysql_query("SELECT id FROM brugere WHERE brugernavn='$regs[2]'");
-
- if($data=mysql_fetch_row($foresp)){
- $brugerSide = "http://$regs[3]/Brugere/visbrugerprofil.php?bruger=$data[0]&type=1";
- }
- }
-
- if($brugerSide){
- $file = fopen ($brugerSide, "r");
-
- while (!feof ($file))
- echo fgets ($file, 1024);
-
- fclose($file);
- exit;
- }
- }
- }
-
- ?>
Det er min top, hvor database connecten ligger.