aim strips out '=' from urls, is there anyway to replace it?
Moderator: General Moderators
-
borisattva
- Forum Newbie
- Posts: 4
- Joined: Wed Feb 01, 2006 1:06 am
aim strips out '=' from urls, is there anyway to replace it?
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.
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.
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
-
borisattva
- Forum Newbie
- Posts: 4
- Joined: Wed Feb 01, 2006 1:06 am
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
I mean a variable..
like that?
Code: Select all
$this = "$_SERVER['QUERY_STRING']";- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
<?php $this = $_SERVER['QUERY_STRING']; ?>-
borisattva
- Forum Newbie
- Posts: 4
- Joined: Wed Feb 01, 2006 1:06 am
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.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.
direct links in IM are ok. profile and away messages appear to be affected.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?
thanks i'll try that tonight.. can this same method process multiple strings btw? .php?%n&%d etc ?jshpro2 wrote:you can get at the query string
page.php?%n
Code: Select all
echo $_SERVER['QUERY_STRING']
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
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
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.
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];
}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
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:
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
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 )
?>- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
Oh, Ive been done with this since the day of my last post.
my code
This does not track a screen name if it is blank, and if it is from my IP address.
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());
}
}
?>