MultiProfile for AIM

 
Post new topic   Reply to topic    Aprelium Forum Index -> Off Topic Discussions
View previous topic :: View next topic  
Author Message
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu Apr 22, 2004 4:34 am    Post subject: MultiProfile for AIM Reply with quote

I wrote a PHP Script called MultiProfile for AIM. It displays different content based on the Screen Name of the user viewing it. I thought it was pretty useful.

Check it out here: http://www.cfxnetworks.com/csa/multiprofile.html

I know there is a lot I can do to improve this script, and I will be writing revised versions every week or so, but right now I will release it how it is. Currently, it does not support screen names with spaces due to the nature of how AIM handles URLs. If I have some extra time, I can try to fix this issue.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu Apr 22, 2004 5:28 am    Post subject: Reply with quote

Well I've been looking around, and I can't seem to find a solution to my space issue. Here's the problem:
When you pass a variable in the URL, which is what I am doing, a browser automatically formats the URL. If the URL has a space, then the browser sticks a %20 where the space goes. The problem is, that AIM does not format the URL with a %20; it instead just leaves it as a space. When the script receives the variable, it cannot handle it, and returns with a "400: Bad Request."

I know there is a method of getting around this; for I have seen it done before.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Apr 22, 2004 6:11 am    Post subject: Reply with quote

have you tried this !

Leaves a space in between words
Code:
$name = urldecode($name);


Shows a + in between words
Code:
$name = urlencode($name);


This keeps dumb spaces from
being sent as % characters.


Last edited by TRUSTAbyss on Thu Apr 22, 2004 6:24 am; edited 3 times in total
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu Apr 22, 2004 6:15 am    Post subject: Reply with quote

Will it work with a query string as oppose to a variable I set (or request) myself?

Note: Encoding the URL is my goal here; because if it doesn't get encoded, it won't work.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Apr 22, 2004 6:19 am    Post subject: Reply with quote

Quote:
Will it work with a query string as oppose to a variable I set (or request) myself?


It should but you might have to create some sort of
variable that opens the URL secretly to decode the
username so that it can work , I will post code later on.

Im pretty sure if you use

Code:

<?php
$name = urldecode($name);
print "Hello $name";
?>


Using A URL like this
http://your-site.com/post.php?name=abyss rules
will show a percent character in the URL but in
the print will print out the 2 words "abyss rules' ok

Online Example:
http://os17fan.cjb.net/php-scripts/post.php?name=Abyss%20Rules
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu Apr 22, 2004 6:38 am    Post subject: Reply with quote

I'm still getting a bad request.
I think the difference is that I am using a conditional statement, whereas your example isn't. Actually, the "urlencode" didn't do the trick. It was the browser that did it. I tried your link in AIM, and the URL didn't encode; it gave the same error as mine.
Code:
<?php
if ($_GET['sn'] == "FFx10 32") {
?>

That's what I'm trying to work with. When AIM fills in the variable "%n," it enters "FFx10 32" without the %20. When that is requested by "$_GET['sn']," PHP can't handle a pure space like that.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Apr 22, 2004 6:41 am    Post subject: Reply with quote

Here's something that should fix your problem
your updated code should be the following! 8)

Code:
<?php
//MultiProfile Script
//Written by iNaNimAtE
//http://www.cfxnetworks.com
$_GET['sn'] = urldecode ($_GET['sn']);
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
}
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
}
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
}
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
}
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
}
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
}
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
}
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
}
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
}
if ($_GET['sn'] == "#ENTER SCREEN NAME HERE#") {
?>
#ENTER PROFILE MESSAGE HERE#
<?php
exit;
} else {
echo '#ENTER MESSAGE ALL OTHER PEOPLE WILL SEE HERE#';
exit;
}
?>
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu Apr 22, 2004 6:52 am    Post subject: Reply with quote

No... it made it worse.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Apr 22, 2004 7:47 am    Post subject: Reply with quote

I don't know what to do than , all I can say is that
the URL will always be %20 but the print out it self
will become seperate words , do you understand ?
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Thu Apr 22, 2004 3:53 pm    Post subject: Reply with quote

No, I understand that. The print out isn't the problem.
Quote:
all I can say is that the URL will always be %20

There is the problem; the URL is not encoded. AIM doesn't encode it.
Therefore, I need to find a workaround.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Off Topic Discussions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group