PHP Easy problem need help

Discussion in 'PHP' started by DnHype, Dec 31, 2007.

  1. #1
    hello i'd like to have simple scirpt that would redirect any visitor is then enter my site like
    if the url is not xxx.com/?money it redirect to it :)

    can't get it worth wtith headerlocation and html java :( anyone ?
     
    DnHype, Dec 31, 2007 IP
  2. najeeborg

    najeeborg Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    maybe this should work:

    
    //Code from http://snipplr.com/view/2734/get-full-url
    function full_url() {
    	$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
    	$protocol = substr(strtolower($_SERVER["SERVER_PROTOCOL"]), 0, strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "/")) . $s;
    	$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
    	return $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
    }
    $control = full_url();
    $redirect = "http://www.xxx.com/?money";
    if ($control != $redirect ) {
    header("Location: ".$redirect);
    } elseif ( $control == $redirect ) {
    echo "";
    }
    
    Code (markup):
    just try, cause i didnt try on any page.
     
    najeeborg, Dec 31, 2007 IP