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. Advertising

  2. cooldaddy

    Brian Wakem Guest

    cooldaddy wrote:

    > 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 ?
    >


    > <input type=text name="name" value=$namE ><br>



    Your error is an HTML one, not perl.


    --
    Brian Wakem
    Email: http://homepage.ntlworld.com/b.wakem/myemail.png
     
    Brian Wakem, Oct 9, 2005
    #2
    1. Advertising

  3. cooldaddy

    Paul Lalli Guest

    cooldaddy wrote:
    > 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.


    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.

    > 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>


    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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laura
    Replies:
    1
    Views:
    565
    Gunnar Hjalmarsson
    Jun 5, 2004
  2. news.frontiernet.net
    Replies:
    6
    Views:
    1,163
    news.frontiernet.net
    Apr 16, 2004
  3. loveNUNO
    Replies:
    2
    Views:
    964
    loveNUNO
    Nov 20, 2003
  4. Merciadri Luca
    Replies:
    4
    Views:
    851
  5. Sandfordc
    Replies:
    11
    Views:
    210
    Random
    Jun 3, 2005
Loading...

Share This Page