View previous topic :: View next topic |
Author |
Message |
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu Apr 22, 2004 4:34 am Post subject: MultiProfile for AIM |
|
|
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 |
|
|
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu Apr 22, 2004 5:28 am Post subject: |
|
|
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 |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Apr 22, 2004 6:11 am Post subject: |
|
|
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 |
|
|
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu Apr 22, 2004 6:15 am Post subject: |
|
|
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 |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Apr 22, 2004 6:19 am Post subject: |
|
|
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 |
|
|
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu Apr 22, 2004 6:38 am Post subject: |
|
|
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 |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Apr 22, 2004 6:41 am Post subject: |
|
|
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 |
|
|
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu Apr 22, 2004 6:52 am Post subject: |
|
|
No... it made it worse. _________________ Bienvenidos! |
|
Back to top |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Thu Apr 22, 2004 7:47 am Post subject: |
|
|
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 |
|
|
iNaNimAtE -
Joined: 05 Nov 2003 Posts: 2381 Location: Everywhere you're not.
|
Posted: Thu Apr 22, 2004 3:53 pm Post subject: |
|
|
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 |
|
|
|