Page 1 of 1
aim strips out '=' from urls, is there anyway to replace it?
Posted: Wed Feb 01, 2006 5:06 pm
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.
Posted: Wed Feb 01, 2006 5:09 pm
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.
Posted: Wed Feb 01, 2006 5:23 pm
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
Posted: Wed Feb 01, 2006 5:26 pm
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.
Posted: Wed Feb 01, 2006 5:47 pm
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?
Posted: Wed Feb 01, 2006 5:48 pm
by josh
you can get at the query string
page.php?%n
Posted: Wed Feb 01, 2006 5:52 pm
by nickman013
Jshpro2, can I make that into a string?
Posted: Wed Feb 01, 2006 6:36 pm
by josh
It is a string
Posted: Wed Feb 01, 2006 7:23 pm
by nickman013
I mean a variable..
Code: Select all
$this = "$_SERVER['QUERY_STRING']";
like that?
Posted: Wed Feb 01, 2006 7:25 pm
by John Cartwright
Code: Select all
<?php $this = $_SERVER['QUERY_STRING']; ?>
Posted: Wed Feb 01, 2006 7:48 pm
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
thanks i'll try that tonight.. can this same method process multiple strings btw? .php?%n&%d etc ?
Posted: Wed Feb 01, 2006 9:07 pm
by nickman013
it used to work because i created my own tracking system for aim.
it just changed overnight, or this morning.
Posted: Wed Feb 01, 2006 9:26 pm
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.
Posted: Thu Feb 09, 2006 10:55 pm
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
Posted: Thu Feb 09, 2006 11:19 pm
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.