no coockie and proxy user redirect

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    no coockie and proxy user redirect

    hi coding talk!

    i´m seraching for the best solution to redirect browsers wich :
    -accept no coockies
    - use proxy

    any elegant solution ?

    #2
    I like rapidshares Proxy redirection setup that redirects web proxys to there site without the proxy...
    im guessing it is done on finding out what the url is but im unsure how you go about redirecting it to same page without the web proxy being used


    for your answer:
    PHP Code:
    //code removed as incorrect .... use gums code below :P 
    at a guess on web proxys:
    PHP Code:
    if($_SERVER['REQUEST_URI']!="your file path")
    {
     
    header("Location: http://yoursite.con");
    exit;

    Last edited by something else; 29.03.12, 19:07.

    Comment


      #3
      for proxy, the example by something else if also good for some web proxies
      PHP Code:
      if ($_SERVER['HTTP_X_FORWARDED_FOR'] || $_SERVER['HTTP_X_FORWARDED'] || $_SERVER['HTTP_FORWARDED_FOR'] || $_SERVER['HTTP_VIA'])
      {
          
      header('Location: http://yoursite.com');

      and for cookie
      first of all set cookie for example on index page add after <?php:
      PHP Code:
      setcookie("your_cookie_name"1time()+3600);  /* expire in 1 hour */ 
      on subpages add this:
      PHP Code:
      if (!isset($_COOKIE['your_cookie_name']))
      {
          
      header('Location: http://yoursite.com/index.php'); /* if no cookie set, redirect back to index (all browsers which dont support cookies will be redirected to the index page all the time */

      Advertise your mobile site for FREE with AdTwirl

      Comment


        #4
        Just was thinking is something like that would be better that something like this but i didn't know what globals they send. Thanks.

        PHP Code:
        $host_ip gethostbyaddr($ip);
        if (
        strcmp($ip$host_ip) == 0) {
        echo 
        'Proxy';

        Last edited by arnage; 29.03.12, 19:05.
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment


          #5
          I like gums solution.many proxy servers use x_forwarded_for .
          to try to give a coockie and request this , is a nice solution.
          thank you gum.i will setup this.

          Originally posted by GumSlone View Post
          for proxy, the example by something else if also good for some web proxies
          PHP Code:
          if ($_SERVER['HTTP_X_FORWARDED_FOR'] || $_SERVER['HTTP_X_FORWARDED'] || $_SERVER['HTTP_FORWARDED_FOR'] || $_SERVER['HTTP_VIA'])
          {
              
          header('Location: http://yoursite.com');

          and for cookie
          first of all set cookie for example on index page add after <?php:
          PHP Code:
          setcookie("your_cookie_name"1time()+3600);  /* expire in 1 hour */ 
          on subpages add this:
          PHP Code:
          if (!isset($_COOKIE['your_cookie_name']))
          {
              
          header('Location: http://yoursite.com/index.php'); /* if no cookie set, redirect back to index (all browsers which dont support cookies will be redirected to the index page all the time */

          Comment

          Working...
          X