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

Thread: variable

  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    92
    Thanks
    1
    Thanked 0 Times in 0 Posts

    variable

    I have a link and the variable to be passed sometimes contains to words with a space between them.If but the variable is one word it works perfectly but if the variable has more than one word only the first word is passed.

    Here's the code.What can i do to pass the whole variable. I feel i should put the variable in quotes or single quotes but that didnt work for me!

    thanks

    PHP Code:
    $link "updatecheck.php?whichdept=" $var

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,642
    Thanks
    2
    Thanked 405 Times in 397 Posts
    urlencode($var)
    But as long as the link has quotes around it when you output it, it should work.

  • #3
    New Coder
    Join Date
    Feb 2007
    Posts
    92
    Thanks
    1
    Thanked 0 Times in 0 Posts
    using the urlencode() method it is still only showing the first word of the variable??

  • #4
    Regular Coder zro@rtv's Avatar
    Join Date
    Feb 2005
    Location
    on the network
    Posts
    433
    Thanks
    0
    Thanked 1 Time in 1 Post
    whats the code look like that prints out $link?
    Is the first word the only part being output or is it the only one being passed when you click the link itself?
    whats the code look like that defines var also?
    ._-zro
    zro@redtv
    zro.redtv.org

    "If HTML and the Web made all the online documents look like one huge book, RDF, schema, and inference languages will make all the data in the world look like one huge database"
    -Tim Berners-Lee, Weaving the Web, 1999


  •  

    Posting Permissions

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