[solved] easy question
Moderator: General Moderators
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
[solved] easy question
Hey, im a little brain dead, and im nto really int he mood to be searching through this big book on how to do this: anways, i have a script taht when someone view my page it takes int heir anem and such, but if there is a space in their name it wont add... hmm... wonder why? i tried stripslahes() and trim() but nothing seems to work.. Any ideas?!
Last edited by Illusionist on Fri Feb 20, 2004 6:19 pm, edited 2 times in total.
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
Code: Select all
<?php
$name = $_GET['name'];
$name = str_replace(" ", "_",$name);
?>-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
What is the output if you use this?
You might be able to use one of those to get the name. I don't know why your script isn't working. When I tested it on my server it kept adding "%20" in between the two parts of my name. (In case you didn't know, %20 = blankspace).
Code: Select all
<?php
echo $_SERVER['REQUEST_URI'] . "<br />";
echo $_SERVER['QUERY_STRING'];
echo "<pre>";
print_r($_GET);
echo "</pre>";
?>-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
ya i know %20 is a blankspace... this si what i get:
and the screename is encrypted bug
it always messes up with there is a space int eh screenname
Code: Select all
/profile/?sn=encryptedsn=encryptedArray
(
їsn] => encrypted
)it always messes up with there is a space int eh screenname
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
hmm.... if i type it into the url, i get teh ocrrect result:
but the other way is comming from a link in the AIM profile window and im using %n to get teh screenname, but it still shows the screenname as encrypted bug, but the page doesn't get it....
Code: Select all
/profile/?sn=encrypted%20%20bug
sn=encrypted%20%20bug
Array
(
їsn] => encrypted bug
)-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
no i dont... What im doing is making sub-profiles for my friends like buddyprofile.com... But the only thing i can't get over now is that when a s/n with spaces clicks teh link it only GETS teh first part of the name fromt he URL. If you know anyone that has a profile hosted by buddyprofile.com, and you have AIM format your s/na nd put a few spaces in it, and then look at their profile. before you click the sub-profile link, look at the URL it has your name at the end witht he spaces, but once you click through if the person has it setup to show the person's name then it will have your name there, wiht no spaces... If not then look at the links for soem of the other pages, they should also have your name int here without the spaces.... How did they format it so that it removes the spaces?! because i haven't even been succesful in retrieve the second part of a name!Illusionist wrote:i found that it is because the URL contains the spaces... but there isn't anything i can do about that... because i'm getting the name from somewehre else and have no control over how it is formated before it gets passed through my page....
Thanks for the help
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA