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
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); 
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.