CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
print - apostrophy and html

 



kumaichi
Deleted

May 24, 2001, 10:37 AM

Post #1 of 4 (462 views)
print - apostrophy and html Can't Post

Hi,

I have ran into a strange problem, at least to me it is. I have a text string

$subject = "my height is 5'8!"

and I want to set this string to the value of an <INPUT>. I have the following code:

print "<INPUT TYPE='text' NAME='subject' VALUE='$subject'></INPUT>\n";

When the web page is displayed all I see in the textbox is "my height is 5", the rest of the string is missing. Can anyone help me get the rest of the string to display?

Thanks in advance for any help you can provide.



freddo
User

May 24, 2001, 12:12 PM

Post #2 of 4 (459 views)
Re: print - apostrophy and html [In reply to] Can't Post

Hi Kumaichi,

If you want to use single quote inside a single-quoted string, use the html metachar &quot;, or use double quotes around the string, like in:
print qq#<INPUT TYPE='text' NAME='subject' VALUE="$subject"></INPUT>\n#;

freddo

;---
Real programmers´butcher dont understand when they just ask for 3735928559.


wickedxter
User

May 24, 2001, 12:15 PM

Post #3 of 4 (459 views)
Re: print - apostrophy and html [In reply to] Can't Post

print "<INPUT TYPE=\"text\" NAME=\"subject\" VALUE=\"$subject\"></INPUT>\n";

when i did that it worked...



kumaichi
Deleted

May 24, 2001, 12:44 PM

Post #4 of 4 (456 views)
Re: print - apostrophy and html [In reply to] Can't Post

Thanks so much for your help, both ways worked great.

Sorry for such a newbie simple question,

Kumaichi


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives