So here is the dologin.php

CODE
<?php
            function Redirect($URL){
                echo "<html><head><meta http-equiv=\"refresh\" content=\"0;url=$URL\"></head></html>";
            }

    if(isset($_POST['username']) && isset($_POST['password'])){
        include "db.php";
        $user = $_POST['username']; $pass = $_POST['password'];
        $mod = $_POST['doget'];
        $sql = mysql_query("SELECT `password` FROM `user` WHERE username = '". $USER ."'");
        $fetch_em = mysql_fetch_array($sql);
        $numrows = mysql_num_rows($sql);

        if($pass == $fetch_em["password"] && !empty($fetch_em["password"])) {
        $valid_user = 1;
        }
        else {
        $valid_user = 0;
        }
        
        if($valid_user == 1) {
        
        setcookie("re_user", $user, time() + 60 * 60, "/");
        setcookie("re_pass", $pass, time() + 60 * 60, "/");
        header("location: http://rage-engine.com/$mod/");
        } else {
        Redirect("http://rage-engine.com/login.php?do=$mod&error=invalid"); die("");
        }
        

    }
    else {
    die(mysql_error());
    }
?>


Edit; nevermind was a syntax error.