moritz and
cool are both right. It is very difficult from your explanation to work out what behaviour you expect to have from your code. Using the modules
moritz has listed would really help to tidy things up and make maintenance and fault finding more easy - as well as helping the monks to help you.
Looking at you code, I guess you want to print the values of "insert", "display" and "confir" which are passed by your HTML template. Once this is done you want to open a file called "table.html" which is in the same directory as the script (you have not listed the contents of this file anywhere...). You then want to look at each line in this file and replace "<-- MESS// -->" with "OK your message has been received!" if the value of insert passed from your HTML form is equal to "insert"; otherwise you will replace "<-- MESS// -->" with "".
I have assumed that "table.html" is your HTML template code. When I run your script from the command line I get:
> perl mess.pl insert=insert display=test2 confir=test3
Content-Type: text/html; charset=ISO-8859-1
<br><b>I must to print these values here once the buttons on the form
+has been clicked:</b><br>***INSERT=insert******DISPLAY=test2******CON
+FIR=test3######<br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric
+t//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Test</title>
</head>
<body>
Test<br>
<form name="upf" method="post">
<input type="hidden" name="update" value="update">
<input type="submit" name="upf" value="Cancel" onClick="docum
+ent.upf.action='test.pl';"> <br><br>
<input type="submit" name="upf" value="Insert" onClick="docum
+ent.upf.action='test.pl?insert=insert';"> <br><br>
<input type="submit" name="upf" value="Confirm" onClick="docu
+ment.upf.action='test.pl?confir=confir';">
</form>
OK your message has been received!
</body>
</html>
This looks like what you might expect. The html is badly formed though since the DOCTYPE declaration comes after you have already outputted some data... browsers will probably interpret it but you may want to tidy this up before going live with it.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.