Page 1 of 1

Simple AIM profile script...

Posted: Tue Oct 11, 2005 10:55 pm
by shoxlx
Ok... i have this very simple aim profile script that takes the user who is viewing another users profile and stores their screen name in a database... here is the link that gets the users screen name...

<a href="http://shoxlx.com/subpro/profile/index.php?username=%n" TARGET="_self">Click to Continue</a>

the %n gets the users screen name... i am using $_REQUEST to get the username from the link when u click on it... what happens is that when a user has a screen name with no spaces in it the script works fine, but when a user has spaces in it the script comes up with an error... if you understand what i just said please help me...

Posted: Tue Oct 11, 2005 10:55 pm
by s.dot
replace spaces with %20

Posted: Tue Oct 11, 2005 11:00 pm
by shoxlx
i cant... see aim uses %n to retrive the users screen name... so the link would look like this...

blablabla/index.php?username=%n...

when the user opens the profile though the %n becomes whatever that users screen name is... so if the users screen name is "Shox Lx" with a space the link would look like

blablabla/index.php?username=Shox Lx

Posted: Wed Oct 12, 2005 12:46 am
by fdesensi
Can you post the error? Its a little tough to say whats going on without seing the error.

Posted: Wed Oct 12, 2005 3:05 am
by malcolmboston
couldnt you do something to the effect of

Code: Select all

$explode = explode("username=", $URLstring);
$username = array_pop($explode);
$username = str_replace(" ", "%20", $username);
??

Posted: Wed Oct 12, 2005 8:30 am
by elecktricity
but if it's in the profile wouldnt it allready get the name? like this

<a href="http://shoxlx.com/subpro/profile/index. ... me=aoluser" TARGET="_self">Click to Continue</a>

so why not give them a link yourself when they signup or something that has the spaces as '%20'

Posted: Wed Oct 12, 2005 1:47 pm
by shoxlx
i cant because this stores the persons screen name... so i need the screen name to be the person and not a pre-set one...

Posted: Mon Oct 17, 2005 7:30 pm
by cheerio
I have an AIM profile script also, but mine is pure flat files.
it will ever work though, because i think AIM strips the spaces...unless it opens in a browser maybe..but dunno

Posted: Mon Oct 17, 2005 7:38 pm
by Chris Corbyn
urlencode() ??

Note: I don't think I have the foggiest idea what the problem is though (and where the %n is being used in PHP)

Posted: Mon Oct 17, 2005 7:40 pm
by cheerio
d11wtq wrote:urlencode() ??

Note: I don't think I have the foggiest idea what the problem is though (and where the %n is being used in PHP)
in AIM profile, aim replaces any instance of %n with the viewers Screen Name.
this way, if you have ?sn=%n, aim will replace it to something like ?sn=[VIEWER'S SCREENNAME HERE]

Posted: Mon Oct 17, 2005 9:16 pm
by d3ad1ysp0rk
I made a AIM subprofile about a year ago and ran into the same problem. I never really found a work around.