Jump to content

hide forwarded url in address bar


madcrazy1

Recommended Posts

Hi,

 

I have a php script that redirects the url input into the address bar by a surfer

user types in address bar:

mysite.com/usersite

user gets to user site but the address bar now shows the redict url

mysite.com/redir?usersiteid=389

this is the bit -o- code :

header("Location: http://" . $_SERVER['HTTP_HOST'] . "/redir?usersite=$usersiteid"); 
} 
else 
{ 
header("Location: http://" . $_SERVER['HTTP_HOST'] . "/infoseek.php");[ /code]

what i want to happen is:
the address bar keeps what the user types in and not the redirect url
help please

Link to comment
https://forums.phpfreaks.com/topic/71074-hide-forwarded-url-in-address-bar/
Share on other sites

  • 2 weeks later...

I tried them and they said they have limited php knowledge,

they gave me this code, it works but a seach engine spider sees it as not found. help please.

 

$requested = ereg_replace("/", '', $_SERVER['REQUEST_URI']); 
$RunThisQuery = "SELECT username, userid from frm_users where username = '$requested'"; 
$result = $connector->query($RunThisQuery); 

if ($connector->fetchNumResult($result) > 0) 
{ 
            $RunThisQuery = "SELECT username, userid from frm_users where username = '$requested'"; 
            $result = $connector->query($RunThisQuery);    
            while ( $row = $connector->fetchArray($result) ) 
               { 
                        $_GET['id'] = $_REQUEST['id'] = $id = $row['userid']; 
            } 
  include('/var/www/html/biz/blog.php'); 
} 
else 
{ 
  header('Location: http://' . getenv('HTTP_HOST') . '/browse.php', true, 301); 
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.