URL Masking in PHP

Reply

Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

URL Masking in PHP

 
0
  #1
Jul 9th, 2006
Does any of you know how to mask a URL in php?? Like the one you see in free URL redirectional services

I mean I have a url like http://www.my-server.com/

which will redirect me to http://www.some-other-server.com/abc.php


by the following PHP command

  1. header("location: http://www.some-other-server.com/abc.php");


But I want the URL in the address bar of my browser to show only this URL

http://www.my-server.com/



Is this possible??





`
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: URL Masking in PHP

 
0
  #2
Jul 9th, 2006
You'll need to use frames for that.
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: URL Masking in PHP

 
0
  #3
Jul 10th, 2006
Personally, I don't like the idea of what you're proposing. IE has (had?) a bug where it will spoof the address so it looks like your page is coming from a legitimate site when really it's coming from a phishing site.

Yes, you can use frames to accomplish the task, but be forewarned that they can annoy your users enough that they never return. I HATE clicking a link and getting trapped in someone's frames.
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 6
Reputation: manishMCAIT is an unknown quantity at this point 
Solved Threads: 0
manishMCAIT manishMCAIT is offline Offline
Newbie Poster

Re: URL Masking in PHP

 
0
  #4
Jul 10th, 2006
hi,
yes it is possible.....

just try this script at your default.php page.. it might be work......

<?php
if (getenv ("HTTP_HOST" )==" www.lab1.com" or
getenv (" HTTP_HOST" )==" www.lab2.com" ) {
header(" Location: http://www.lablockers.com/labweb/default.htm" );
exit;
}

?>



Originally Posted by cancer10
Does any of you know how to mask a URL in php?? Like the one you see in free URL redirectional services

I mean I have a url like http://www.my-server.com/

which will redirect me to http://www.some-other-server.com/abc.php


by the following PHP command

  1. header("location: http://www.some-other-server.com/abc.php");

But I want the URL in the address bar of my browser to show only this URL

http://www.my-server.com/



Is this possible??





`
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Re: URL Masking in PHP

 
0
  #5
Jul 10th, 2006
Originally Posted by manishMCAIT
hi,
yes it is possible.....

just try this script at your default.php page.. it might be work......

<?php
if (getenv ("HTTP_HOST" )==" www.lab1.com" or
getenv (" HTTP_HOST" )==" www.lab2.com" ) {
header(" Location: http://www.lablockers.com/labweb/default.htm" );
exit;
}

?>

And wot this code will do?
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 6
Reputation: manishMCAIT is an unknown quantity at this point 
Solved Threads: 0
manishMCAIT manishMCAIT is offline Offline
Newbie Poster

Re: URL Masking in PHP

 
0
  #6
Jul 10th, 2006
<?php
if (getenv ("HTTP_HOST" )==" www.lab1.com" or
getenv (" HTTP_HOST" )==" www.lab2.com" ) {
header(" Location: http://www.lablockers.com/labweb/default.htm" );
exit;
}
?>
or you can use frame to do that ..


<frameset rows="*,*">
<frame name="header" scrolling="no" noresize target="main" src="traffic2.php?user=41393&displayedsite=21343&newlastsite=64&newurl=http://www.dragonsky.com.cn/emoney.htm">
<frame name="main" src="http://www.dragonsky.com.cn/emoney.htm">

<noframes>
<body>

<p>This page uses frames, but your browser doesn't support them.</p>

</body>
</noframes>
</frameset>


or u can use .htaccessdoc for this url passing
http://www.freewebmasterhelp.com/tutorials/htaccess
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: URL Masking in PHP

 
0
  #7
Jul 10th, 2006
Since you have post it in PHP section, we should at least do it in PHP way :cheesy:
If the content of other site is store within the same folder, you can use include function to get the content to display. If the content is from other website, then get the permission first then do the following
[php] $crawl = 'http://www.domain.com/target_page.html';
$fd = fopen($crawl, "r");
while($buf = fgets($fd,1024))
{
echo $buf;
}
fclose($fd);
[/php]You may have broken link of images and links, but since you know the url, you can do some trick in your program to overcome it. For example, having a line at the beginning of the page with HTML <base ...>
Last edited by zippee; Jul 10th, 2006 at 6:41 pm.
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC