one word

Discussion in 'Perl Misc' started by cooldaddy, Oct 9, 2005.

  1. cooldaddy

    cooldaddy Guest

    On my site I wanna generate a form based on a databse. Now when I try
    to populate this form something strange happens. The string $namE
    contains several words, seperated by spaces. However when I populate
    the form, the script only prints out the first word. How come, and how
    to solve this ?


    #!/usr/bin/perl
    use CGI;
    my $q = new CGI;

    $namE="test this form";
    print $namE;

    print qq{
    <html>
    <head>
    <title>Untitled</title>
    </head>

    <form method="post" action="../cgi-bin/savetext.pl">
    Name<br>
    <input type=text name="name" value=$namE ><br>
    Email<br>
    <input type=text name="email" value=$emaiL ><br>
    Text<br>
    <textarea cols="60" rows="24" name="text" style="background-color:
    #ffffff; color: #000000; font-size: 11pt;">
    $texT
    </textarea><br>
    <input type=hidden name="part" value=$ARGV[0]$part>





    <input type=submit value="send">
    </form>

    </html>
    };
     
    cooldaddy, Oct 9, 2005
    #1
    1. Advertisements

  2. cooldaddy

    Brian Wakem Guest


    Your error is an HTML one, not perl.
     
    Brian Wakem, Oct 9, 2005
    #2
    1. Advertisements

  3. cooldaddy

    Paul Lalli Guest

    No it doesn't. The script prints exactly what you told it to print.
    Your webbrowser, however, is not interpreting the results of the
    script's output the way you think it is.
    Have you viewed the source of the webpage that has this result? You
    will see that $namE was correctly expanded. If you don't know why
    you're getting the results you're seeing when the script's output is
    viewed in a web browser, you need to contact a group that deals with
    HTML.

    Paul Lalli
     
    Paul Lalli, Oct 9, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.