| | |
URL Masking in PHP
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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
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??
`
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
PHP Syntax (Toggle Plain Text)
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??
`
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!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
•
•
Join Date: Jul 2004
Posts: 494
Reputation:
Solved Threads: 21
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.
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.
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.
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Solved Threads: 0
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;
}
?>
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
PHP Syntax (Toggle Plain Text)
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??
`
•
•
•
•
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?
•
•
Join Date: Jun 2006
Posts: 6
Reputation:
Solved Threads: 0
<?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
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
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 ...>
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.
![]() |
Similar Threads
- URL Rewrite in PHP (PHP)
Other Threads in the PHP Forum
- Previous Thread: validating creditcard info
- Next Thread: how deposit a picture to MYSQL database
| Thread Tools | Search this Thread |
apache api array beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external file files folder form forms forum freelancing function functions google header headmethod howtowriteathesis href htaccess html iframe image include incode insert ip javascript joomla limit link login mail malfunction menu method mlm mod_rewrite multiple mysql neutrality oop pageing paypal pdf php phpmysql play problem query question radio random recursion recursiveloop remote root script search select server sessions sms soap source space sql support! syntax system table template tutorial update upload url validator variable video web youtube






