Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Space in column value

    Hi,

    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:
    PHP Code:
    echo "<b><font color=\"green\">Enabled</font><a href=admintoon.php?toonname=".$n['toonname']."&enabled=0>>>DISABLE<<</font></b>"
    Thank-you ..
    Last edited by ThunderLee; 03-22-2009 at 07:27 AM.

  • #2
    Regular Coder sea4me's Avatar
    Join Date
    Jan 2009
    Location
    Damn, I don't know...
    Posts
    390
    Thanks
    11
    Thanked 28 Times in 27 Posts
    You sure you have persons name in $n['toonname']??

  • #3
    Codeasaurus Rex
    Join Date
    Jun 2008
    Location
    Redmond, WA
    Posts
    660
    Thanks
    31
    Thanked 100 Times in 94 Posts
    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']."

    Code:
    ".str_replace(" ","%20",$n['toonname'])."
    That should fix your problem.
    Unless otherwise stated, any code posted is most likely untested and may contain syntax errors.
    My posts, comments, code, and suggestions reflect only my personal views.
    Web Portfolio and Code Snippets: http://shanechism.com

  • Users who have thanked ShaneC for this post:

    ThunderLee (03-22-2009)

  • #4
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank-you so much!! I was wondering how to fix that ..


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •