aim strips out '=' from urls, is there anyway to replace it?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
borisattva
Forum Newbie
Posts: 4
Joined: Wed Feb 01, 2006 1:06 am

aim strips out '=' from urls, is there anyway to replace it?

Post by borisattva »

i just began learning PHP and as an excersise i'm writing a script that would be called from within my AIM profile, and take the clicker wherever they want to go, but also track their user name to see who visited what, and store that information in a database (which should cover various aspects of scripting and let me practice)

to those who dont know AIM uses %n internally so whoever clicks on a link containing that from within AIM, it will replace the %n with their screen name.

i have made a script goto.php?u=%n&d= which intakes users screen name.

however when a person clicks AIm strips out the = bit making the link come up as goto.php?nScreenname (as opposed to goto.php?u=Screenname.

i'm guessing they disabled it in some clumsy attempt to prevent.. something..

my question is, is there a way to make the script consider some other character as the '=' setter?

BTW strangely enough every single cllient i tested is affected with this, Aim, Gaim, DeadAim, Aim+ (havent tested trillian) so i'm guessing this filtering takes place on AOL delivery of the link.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

I have the same thing in my profile. I made it myself, and AIM doesnt take the '=' sign away from mine.

Sounds wierd. May be your computer.

EDIT: I just tried it on my link, it doesnt work. It did, I think they took it off! It doesnt work on IMCHAOS either.
borisattva
Forum Newbie
Posts: 4
Joined: Wed Feb 01, 2006 1:06 am

Post by borisattva »

bastids...

so back to the question, is there anyway to rewrite the default = in the URL varibale acquisition? to lets say ~ or whatever
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

I dont even know. This sucks. Hopefully someone on this forum will think of something.

It happend around last night / today becuase It did work last night.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Where is it being stored that it is being stripped?

The IM's sent don't have it stripped, so where are you storing it that it is being stripped?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

you can get at the query string

page.php?%n

Code: Select all

echo $_SERVER['QUERY_STRING']
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

Jshpro2, can I make that into a string?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

It is a string
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

I mean a variable..

Code: Select all

$this = "$_SERVER['QUERY_STRING']";
like that?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

<?php $this = $_SERVER['QUERY_STRING']; ?>
borisattva
Forum Newbie
Posts: 4
Joined: Wed Feb 01, 2006 1:06 am

Post by borisattva »

nickman013 wrote:I dont even know. This sucks. Hopefully someone on this forum will think of something.

It happend around last night / today becuase It did work last night.
it may have been on for a while but noone noticed. ive been playing with this for a few days before i decided to ask a php community and searching google resulted in nothing. other services that offer this on ad based are probably arent even aware.. the crack down is probably to be a PITA for those websites.
Roja wrote:Where is it being stored that it is being stripped?

The IM's sent don't have it stripped, so where are you storing it that it is being stripped?
direct links in IM are ok. profile and away messages appear to be affected.
jshpro2 wrote:you can get at the query string

page.php?%n

Code: Select all

echo $_SERVER['QUERY_STRING']
thanks i'll try that tonight.. can this same method process multiple strings btw? .php?%n&%d etc ?
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

it used to work because i created my own tracking system for aim.

it just changed overnight, or this morning.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

If you need to simulate a GET just set up your own internal delim character, let's say the pipe ( | )


page.php?key-value|key-value

Code: Select all

$get=array();
foreach(explode('|',$_SERVER['QUERY_STRING']) as $get) {
     $get = explode('-',$get);
     $my_get[$get[0]]=$get[1];
}
then change all your $_GET to $get (I don't know if PHP let's you overload the $_GET variable but I wouldn't)...

I bet there's a way to do it in mod_rewrite as well, I'm not sure how you would accept a variable number of matches in a RewriteRule but if it can be done it will let your applications that currently use $_GET work un-changed.
borisattva
Forum Newbie
Posts: 4
Joined: Wed Feb 01, 2006 1:06 am

Post by borisattva »

i only now got around to continue with this, and implemented the code you provided above.
all entries turned out blank in log, so i isolated the code and tested it as follows:

Code: Select all

<?php

	$get=array(); 
	foreach(explode('|',$_SERVER['QUERY_STRING']) as $get)
	{ 
		$get = explode('-',$get); 
		$my_get[$get[0]]=$get[1]; 
	}

	#assign variable
	$time = date("H:i dS F");
	$screenname = $get['u'];
	$ip = $_SERVER['REMOTE_ADDR'];

	echo ( $screenname )
	echo ( $ip )

 ?>
the ip displayes without a problem but screenname is just replaced with a blank space as if there is nothing attained from the test.php?u-testuser
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

Oh, Ive been done with this since the day of my last post.

my code

Code: Select all

<?
$username= "this";  
$password= "that";  
$database= "who";  
$connection = mysql_connect('localhost',$username,$password);  
mysql_select_db($database); 
$get=array(); 
foreach(explode('|',$_SERVER['QUERY_STRING']) as $get) { 
     $get = explode('-',$get); 
     $my_get[$get[0]]=$get[1]; 
} 
$sn2 = str_replace("%20", "", $get[0]); 
$sn = str_replace("sn=", "", $sn2);
if ($_SERVER['REMOTE_ADDR']  != '68.195.158.8') 	{
if ($sn  != '') 						{
$date = date("m.d.y");
$time = date('g:i a',time()+3600);
$ip = @$REMOTE_ADDR; 
$sql = "INSERT INTO  `Tracker` (  `Number` ,  `Screen Name` ,  `Page` ,  `Date` ,  `Time` ,  `IP` ) 
VALUES (
'',  '$sn',  '$page',  '$date',  '$time',  '$ip'
);
";
$result = mysql_query($sql) or die(mysql_error()); 


													}
										}

?>
This does not track a screen name if it is blank, and if it is from my IP address.
Post Reply