SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist =X='s Avatar
    Join Date
    Jun 2001
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    value with spaces in a textbox...

    if you have a textbox with value=$test and you defined "$test=I am testing" then the output will be "I"

    how can you solve this? and if I submit the form, that text must still contain normal spaces...
    PHP-Webservices - Profesional Hosting and Programming of sites.

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you provide your actual code? This shouldn't be happening, if I understand you correctly.

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    make

    value=$test

    or

    <input type="text" name="" value=$test>

    value="$test"

    or

    <input type="text" name="" value="$test">
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    SitePoint Evangelist =X='s Avatar
    Join Date
    Jun 2001
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, here's not the code for the real script, but just a test you can upload to see the result, this gives the error too
    PHP Code:
    <html>
        <head>
            <title>m</title>
        </head>
    <body>

    <?php $test="this is a test";
            print 
    "<form method=post action=\"no.php\"><input type=\"text\" value=$test></form>";
    ?>
    </body>
    </html>
    PHP-Webservices - Profesional Hosting and Programming of sites.

  5. #5
    SitePoint Evangelist =X='s Avatar
    Join Date
    Jun 2001
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heh
    thx freddydoesphp
    that was a stupid solution
    should've knew that myself
    /me hits myself for punishment
    PHP-Webservices - Profesional Hosting and Programming of sites.


Bookmarks

Posting Permissions

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