I am creating a site like subprofile.com and the other profile websites for AOL Instant Messenger profiles. I have everything done except for one thing. Screennames that have spaces in them cannot view the profiles.

My s/n (screenname) is malakai015. I am able to view the profiles fine with this name. When I changed it to malakai 015 i was unable to view it. I get a "Error Loading Content". I dont see why, because it works fine in the Internet Explorer browser. The link from my profile looks like this: http://www.sycloneweb.net/view.php?n=geedubya&sn=%n

The sn part is the screenname of the AIM user viewing the profile. (%n changes to the screenname. its just AIM's code for whatever the s/n is.)

I tried all of the following to replace the spaces in the s/n with %20.
$sn = str_replace(" ", "%20", "$sn");
$sn = ereg_replace (" ", "%20", $sn);
$sn = preg_replace(" ", "%20", $sn);
$sn = strtr($sn, " ", "%20");
Then i tried getting rid of the space.
$sn = str_replace(" ", "", "$sn");
$sn = ereg_replace (" ", "", $sn);
$sn = preg_replace(" ", "", $sn);
$sn = strtr($sn, " ", "");

I also tried
urlencode($sn);
rawurlencode($sn);

(I think subprofile.com and madprofile.com take away the space other than adding the %20. I think that is the right way.)
None of these ways worked.

Has anyone every done this before in AOL Instant Messenger. This is the last thing i gotta do before the sites done, but i cant get it working.

My s/n is malakai015 and geedubya15 if you need to contact me.

    Write a Reply...