View Full Version : Resolved Space in column value

03-22-2009, 05:18 AM

I have a problem, I have a link on my admin page that disables a user when I click it.. The only problem is that if the users name has a space in it the URL doesn't work..

like.. whateverpage.php?name=persons name

it just appears as: whateverpage.php?name=persons

How do I get it so all the name will be together like =personsname?

I'll post a part of my code..

This is the link on the page:

echo "<b><font color=\"green\">Enabled</font><a href=admintoon.php?toonname=".$n['toonname']."&enabled=0>>>DISABLE<<</font></b>";

Thank-you :)..

03-22-2009, 06:07 AM
You sure you have persons name in $n['toonname']??

03-22-2009, 06:16 AM
If it has a space in the name then the link should be Persons%20Name in the URL. %20 is the HTTP equivalent of a space, and that's probably your problem.

My first suggestion to you is recommending HIGHLY that you store usernames as one word, substituting an underscore for a space, in your database. That prevents problems such as this and many others.

Otherwise, just put this piece of code in place of just ".$n['toonname']."

".str_replace(" ","%20",$n['toonname'])."
That should fix your problem.

03-22-2009, 07:26 AM
Thank-you so much!! I was wondering how to fix that :)..