db_com_open()) echo "connection failed
".$db->db_com_get_last_error()."
"; if(!$db->db_com_select_db($dbname)) echo "selection of database failed
".$db->db_com_get_last_error()."
"; if(!$db->db_com_query($sql)) echo "query failed
".$db->db_com_get_last_error()."
"; //Auswahl aufzurufenden Seite - Zufall $zufall=2; $sql="SELECT url,pos from webring_inhalt where pos=$zufall"; $db = new db_com; if(!$db->db_com_open()) echo "connection failed
".$db->db_com_get_last_error()."
"; if(!$db->db_com_select_db($dbname)) echo "selection of database failed
".$db->db_com_get_last_error()."
"; if(!$db->db_com_query($sql)) echo "query failed
".$db->db_com_get_last_error()."
"; while($result = $db->db_com_get_next_result()) { $link=$result[0]; $pos=$result[1]; } $db = new db_com; $woher=3; $sql ="INSERT into webring (ip,aufruf,datum,seitenname,browser) values ('".$ip."',".$pos.",'".$datum."',$woher,'".$wie."')"; $db = new db_com; if(!$db->db_com_open()) echo "connection failed
".$db->db_com_get_last_error()."
"; if(!$db->db_com_select_db($dbname)) echo "selection of database failed
".$db->db_com_get_last_error()."
"; if(!$db->db_com_query($sql)) echo "query failed
".$db->db_com_get_last_error()."
"; header("Location:$link"); ?>