Jump to content

Anonymize all links?


dunnsearch

Recommended Posts

Oh ok. Gotcha. You'd have to register multiple domain names and have them point to your server. You'd have to get the IP address of your server, have the domain name point to that IP and set up a Parked domain on your server. You can do the later through CPanel if you have it.

Link to comment
https://forums.phpfreaks.com/topic/124390-anonymize-all-links/#findComment-642940
Share on other sites

i'm glad you two know what your on about because i'm not too sure.

Are the links on your site, to your site, or from else where to yours.

Is it the page or the domain your wanting to hide, because eventually they'll be in the know... unless another site cURLs them for you, but i'd have to ask why...

Link to comment
https://forums.phpfreaks.com/topic/124390-anonymize-all-links/#findComment-643278
Share on other sites

i'm glad you two know what your on about because i'm not too sure.

 

I'm not either.

 

thanks. but is there a code you could i could put into my template or all of my html pages?

 

What?

 

@jordanwb - you seem to be lost.

 

Not really. I understand what he wants to do now that he's explained it more clearly.

Link to comment
https://forums.phpfreaks.com/topic/124390-anonymize-all-links/#findComment-643295
Share on other sites

what is confusing? all links posted on my website to get dunnsearch.us/? before them. i have made a script for my .htaccess, but it will make links from my website to my website anonymous to! i only want the links from my website that are linked to another website outside my websites url. any ideas?

Link to comment
https://forums.phpfreaks.com/topic/124390-anonymize-all-links/#findComment-644243
Share on other sites

You could do something like this:

 

<?php

$text = preg_replace('/http:\/\/([^\/]+)[^\s]*/', '<a href="http://dunnsearch.us/?$0" target="_blank">$1</a>', $text);
?>

 

You'll have to tell me if the above code doesn't work or need help implementing it. I haven't exactly tested it.

Link to comment
https://forums.phpfreaks.com/topic/124390-anonymize-all-links/#findComment-644283
Share on other sites

You could do something like this:

 

<?php

$text = preg_replace('/http:\/\/([^\/]+)[^\s]*/', '<a href="http://dunnsearch.us/?$0" target="_blank">$1</a>', $text);
?>

 

You'll have to tell me if the above code doesn't work or need help implementing it. I haven't exactly tested it.

 

Doesnt seem to work for me? Thank you so much any way do :)

Link to comment
https://forums.phpfreaks.com/topic/124390-anonymize-all-links/#findComment-645042
Share on other sites

Well you'll have to put it inside a function like so:

 

<?php
function anonymize_links($text){
	$text = preg_replace('/http:\/\/([^\/]+)[^\s]*/', '<a href="http://dunnsearch.us/?$0" target="_blank">$1</a>', $text);
}
?>

 

 

And then to actually use it:

<?php
$string = 'Hello world! Check out http://foobar.com right now!';
anonymize_links($string);
//Will output "Hello world! Check out <a href="http://dunnsearch.us/?http://foobar.com">http://foobar.com</a> right now!"
?>

 

 

I just tested this and it works for me. So you might not have it set up correctly.

Link to comment
https://forums.phpfreaks.com/topic/124390-anonymize-all-links/#findComment-645269
Share on other sites

  • 1 month later...

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.