AlexanderTheBest Posted December 18, 2006 Share Posted December 18, 2006 Okay, here's my delima.I would like to have a php script that (when the link is clicked) appends [b]http://anonym.to/?[/b] in front of every [b][i]outgoing[/i][/b] http:// link (For those of you who don't know, anonym.to is an anonomous proxy redirection service).I also would like the script to bring up a new browser window that displays a message like "you are now exciting this website bla bla bla we can't be held responsible for anything that happens as a result, etc." and then (after like 4-6 seconds) forwards the user to the link they clicked (of course, with the [b]http://anonym.to/?[/b] in front of it.).How would I do that? ??? :-\ :-[Thanks so much for helping a dumb n00b who's trying to figure out the ropes. :-X Link to comment https://forums.phpfreaks.com/topic/31098-redirection/ Share on other sites More sharing options...
Psycho Posted December 18, 2006 Share Posted December 18, 2006 If you want the user to go to http://anonym.to/something.html, just make that the link. PHP cannot change the link that is already on the page. Same goes for the exit message. PHP is all handled server side.Now, what you can do is create a page to handle all your links. Let's call it the links page (links.php). Then all the links to external pages on your site would be formatted something like this http://mysite.com/links.php?url=theexternalurlThen your links page would show the temporary exiting message and then use javascript to then redirect to the actual external url. Link to comment https://forums.phpfreaks.com/topic/31098-redirection/#findComment-143693 Share on other sites More sharing options...
AlexanderTheBest Posted December 18, 2006 Author Share Posted December 18, 2006 I don't think you quite understand what I am trying to do... :-\I am trying to set up some kind of script that routes people's links trough a proxy to shield the referring url (my website) from the site that they are going to.If you wanted to go to:http://www.Google.comYour link would display:http://www.Google.com but when you click it, the link would be calculated as an [u]outgoing[/u] url (the script automatically notices any url without MY website's domain name in it as an outgoing url) and the script would automatically append http://anonym.to/? to the beginning of the url and then forward the user to the link that they clicked. aka:http://anonym.to/?Http://www.Google.com[u]after[/u] displaying a browser window that tells the user that the site they are about to visit is not part of/affiliated with the website they currently are on.The google link with http://anonym.to/? is simply the same link as Http://www.Google.com, EXCEPT the user FIRST goes through a proxy (that then automatically redirects them to the site they wanted to visit in the first place).I am positive it can be done, because I've seen it be implimented. ??? Link to comment https://forums.phpfreaks.com/topic/31098-redirection/#findComment-143743 Share on other sites More sharing options...
Psycho Posted December 18, 2006 Share Posted December 18, 2006 I don't think you understand what PHP can and cannot do. PHP is run server-side. When a user clicks a link it directs the browser to the URL specified. PHP cannot dynamically change the url of a link after the page has been delivered to the user.[quote]I am positive it can be done, because I've seen it be implimented.[/quote]It was not implemented int he manner you think. If anything it was something like I described above. Either 1) the links "look" like they point to one place, but the actual url is to someplace else, 2) There is some javascript going on that is changing the url's after the page is loaded, or 3) it is a combination of the two.Again, PHP cannot take any action on a page once it has been delivered to the user. Link to comment https://forums.phpfreaks.com/topic/31098-redirection/#findComment-143750 Share on other sites More sharing options...
AlexanderTheBest Posted December 18, 2006 Author Share Posted December 18, 2006 Ugh... I guess I'm even more of a n00b than i thought... :-\The reason I can't just 'put' http://anonym.to/? on the beginning of the links is because this/the script/scripts is/are going to be used in a forum environment, and the members are a little braindead ::) and don't listen to the forum rules very well...Anyway, so I basically need a Javascript that will change all urls (that don't have my domain name in them) to have http://anonym.to/? on the beginning of them,and then use another JavaScript to bring up the page telling the user that they are about to leave my site?Thanks again for your help and sorry I'm sorta a dumbass... ??? Link to comment https://forums.phpfreaks.com/topic/31098-redirection/#findComment-143758 Share on other sites More sharing options...
Psycho Posted December 18, 2006 Share Posted December 18, 2006 If this is for a forum, then you can use PHP to do what I described in my first post: that is when a user posts a message, parse the message to find any links. I would assume you are already parsing the post for url's anyway. Then reformat the links to point to a "links" processing page passing the url as a parameter on the query string. Then create the links processing page as I described before.You could use javascript to dynamically change the urls for the links, but you would still need to point to an internal page if you want to show an exit message.If you have code for extracting/processing the urls in a post, post that here and I can help further. Link to comment https://forums.phpfreaks.com/topic/31098-redirection/#findComment-143846 Share on other sites More sharing options...
AlexanderTheBest Posted December 18, 2006 Author Share Posted December 18, 2006 Good Lord I am going to sound like a retard... :oI know nothing. :-[ :'(I am using vBulletin Version 3.6.4 for my forum right now. :-\What files would you need to have access to? ??? Link to comment https://forums.phpfreaks.com/topic/31098-redirection/#findComment-143853 Share on other sites More sharing options...
Psycho Posted December 19, 2006 Share Posted December 19, 2006 I am assuming that bulletin board uses BB code. You will need to find the file(s) that contain the code for parsing the URL's entered into posts. Then modify it accordingly. Link to comment https://forums.phpfreaks.com/topic/31098-redirection/#findComment-144088 Share on other sites More sharing options...
Snooble Posted December 19, 2006 Share Posted December 19, 2006 Also, anomyn.to is the page that shows up explaining you are being diverted. So you dont type your own message. They have a default. Black background, red links i believe.anoyn do most the work, plus. if its for phpbb, just download from http://phpbbhacks.com/ and find the correct mod to instal... Easy as pie.Snooble Link to comment https://forums.phpfreaks.com/topic/31098-redirection/#findComment-144124 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.