AIM Screen Name Spaces

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

AIM Screen Name Spaces

Post by d3ad1ysp0rk »

Loading
http://www.404-design.net/aim/subprofile.php?sn=lps (in an AIM window) works; but this does not:
http://www.404-design.net/aim/subprofile.php?sn=l ps

for the reason (from what others have said) that AIM does not convert spaces into %20s in the URL, so using %n (replaces %n with their screen name) in this:
http://www.404-design.net/aim/subprofile.php?sn=%n

works, until you run into someone with a space in their name, instead of loading the subprofile, it gives you the "Error Loading Content" crap.


I tried using str_replace, but it's not seeming to work.. any ideas?
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Force your friends to get a new name with an underscore instead of a space. ;)
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

lol

one of my friends was like "ur subprofile still says "error loading content" ya know?"

im like "Yea, it's cuz u have spaces, get rid of them dumb@$$ ;)"

him: "why don't you do your job and FIX it?! a$$hole!" :P
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

Or take a look to [php_man]urlencode[/php_man]():

Code: Select all

<pre>
<?php
print_r($_GET);
echo '<a href="' . $_SERVER['PHP_SELF'] . '?test=' . urlencode('test test % á @#' . $_GET['test']) . '">next</a>';
?>
</pre>
One output:

Code: Select all

&lt;pre&gt;
Array
(
    &#1111;test] =&gt; test test % á @#
)
&lt;a href="/lab/get.php?test=test+test+%25+%E1+%40%23test+test+%25+%E1+%40%23"&gt;next&lt;/a&gt;&lt;/pre&gt;
Hope that works with AIM.

Cheers,
Scorphus.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

whoever clicked those links, can u please leave ur browser name or go to http://www.404-design.net/aim/test.php

cuz my if statement says:

Code: Select all

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var navName = navigator.appName;
if (navName == "Microsoft Internet Explorer" || navName == "Netscape") &#123;
   window.location = "error.php?e=browser";
&#125;
//  End -->
</script>
which includes most browsers (mozilla, netscape, ie, and a few others), but i guess it doesnt cover one of your browsers (because it still saved the screen name.. (meaning the loop didnt run..)

thanks
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

I'm using Mozilla Firebird 0.7 and the page at that link displays one word: 'Netscape'
Post Reply