Simple AIM profile script...

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
shoxlx
Forum Newbie
Posts: 23
Joined: Tue Oct 11, 2005 10:42 pm

Simple AIM profile script...

Post 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...
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

replace spaces with %20
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
shoxlx
Forum Newbie
Posts: 23
Joined: Tue Oct 11, 2005 10:42 pm

Post 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
User avatar
fdesensi
Forum Newbie
Posts: 11
Joined: Tue Oct 11, 2005 6:17 pm
Location: Pittsburgh

Post by fdesensi »

Can you post the error? Its a little tough to say whats going on without seing the error.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post 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);
??
User avatar
elecktricity
Forum Contributor
Posts: 128
Joined: Sun Sep 25, 2005 8:57 pm
Location: Trapped in my own little world.
Contact:

Post 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'
shoxlx
Forum Newbie
Posts: 23
Joined: Tue Oct 11, 2005 10:42 pm

Post 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...
cheerio
Forum Newbie
Posts: 18
Joined: Sat Aug 13, 2005 4:52 pm

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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)
cheerio
Forum Newbie
Posts: 18
Joined: Sat Aug 13, 2005 4:52 pm

Post 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]
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

I made a AIM subprofile about a year ago and ran into the same problem. I never really found a work around.
Post Reply