/    Sign up×
Community /Pin to ProfileBookmark

Public comments page – how to format results?

I am trying to format the page that takes in the entries to a page where I invite visitors to contribute short messages.

My host uses an Apache server; it offers a proprietary web-gagdet called MAILIT, which has many capabilities. After a quick chat with tech support, I managed to kludge a page for visitors to enter thoughts or comments. I want these to be a blog-like thing with people contributing at will.

In testing, astoundingly, I got the thing to work. My ISP offers docs, but I don’t understand the docs! Should I post them here? I don’t think they’re available normally to non-customers. Anyway, they say to format the results of the entry, you can use a template file. I have no idea what one would look like, nor how to construct it. Undoubtedly, both HTML and CSS will be involved in constructiong the “reply” (same idea as a “thank you” page for comments).

Here’s my current code for the visitor entry page:

[code]
<div class=”feedput”>
<form method=”post” action=”/cgi-bin/mailit”>
<p><input type=”hidden” name=”login” value=”cwhitney” /></p>
<p><input type=”hidden” name=”reply” value=”http://www.coherentdog.org/blogdisplay.htm” /></p>
<p><input type=”hidden” name=”mandatory” value=”firstname lastname email subject message” /></p>
<p><input type=”hidden” name=”sitename” value=”sitename” /></p>

<!–; I don’t yet know how to handle the template part of this!–>
<!– ; <input type=hidden name=template value=”order.tpl”> –>
<!– ; sitemessages will be a single data file with a .db extension in my ROOT dir –>

<p><input type=”hidden” name=”file” value=”blogforcarolonly” /></p>
<!– <p><input type=”hidden” name=”template” value=”remarkstpl” /></p> –>
<p><input type=”hidden” name=”format” value=”human” /></p>
<p><input type=”hidden” name=”fields” value=”firstname lastname email sitename subject message” /></p>

<p><input type=”hidden” name=”file2″ value=”/www/blogremarks” /></p>
<!– <p><input type=”hidden” name=”template” value=”remarkstpl” /></p> –>
<p><input type=”hidden” name=”format2″ value=”human” /></p>
<p><input type=”hidden” name=”fields2″ value=”firstname sitename subject message” /></p>

[skipping instructions to visitors]

<p>What is your first name?<br /><input type=”text” name=”firstname” size=”25″ /></p>
<p>What is your last name (not published)?<br /><input type=”text” name=”lastname” size=”25″ /></p>
<p>Please enter your email address (not published)<br /><input type=”text” name=”email” size=”50″ /></p>
<!– <p>If you would like, you may include the URL of your web site<br /><input type=”text” name=”sitename” size=”50″ /></p> –>
<p>Please type a subject for your message<input type=”text” name=”subject” size=”40″ /></p>

<p><textarea name=”message” rows=”20″ cols=”40″>Please type your remarks here</textarea></p>

<p><input type=”submit” value=”Click here to add your remarks” /></p>
<p><strong>or</strong></p>
<p><input type=”reset” value=”Start over” /></p>
</form>
</div>
[/code]

And CSS is:

[code]

.feedput {
font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;
font-size: 100%;
margin: 1em;
padding: 2em;
text-align: left;
}

.feedbutton {
margin: 1em;
padding: 2em;
font-family: Verdana,Geneva,Arial,Helvetica,sans-serif;
font-weight: normal;
font-size: 100%;
text-align: center;
}

[/code]

The page that takes in the data:

HTML

[code]
<div id=”column2″>

<h2>Remarks by CoDog Visitors</h2>

<p>Thank you for your message</p>

<p>Remarks by you and others</p>

<div>

<!–#include file=”blogremarks.db” –>

</div>

[/code]

As you see, there’s nothing in that code at all except stuff I write to the visitor.

Here is a sample entry; this is from the blogremarks.db file, unaltered:

[code]

firstname: Almali
sitename: sitename
subject: gosh; I am dedicated
message: This is a mess, you know; you will HAVE to learn to format this stuff before putting this page up.

So you need a template, but you have no idea how to go about that, nor do I.

Tue, 05 Apr 2005 18:29:41

P.S. my info is still here when I come back to this page! Is it left there for th next person? I hope not!

Tue, 05 Apr 2005 18:30:11

Almali
[/code]

On the page it’s fed back to, it looks like this (here I include a bit of the previous entry as well as the entry that follows, so ou can see the mess:

[code]
how about a URL? http://www.coherentdog.org/ How will those come out? Tue, 05 Apr 2005 18:27:36 Almali firstname: Almali sitename: sitename subject: gosh; I am dedicated message: This is a mess, you know; you will HAVE to learn to format this stuff before putting this page up. So you need a template, but you have no idea how to go about that, nor do I. Tue, 05 Apr 2005 18:29:41 P.S. my info is still here when I come back to this page! Is it left there for th next person? I hope not! Tue, 05 Apr 2005 18:30:11 Almali firstname: Almali sitename: sitename subject: Please put the sitename field back in?
[/code]

So obviously, that’s come back unformatted, with one entry running right into the next one. At least it came back. I have no idea what to do, how to make a template, nor where to put the template, or anything!

Thanks for any help anybody can offer!

Thu, 07 Apr 2005 17:30:58

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@FangApr 08.2005 — Give a link to your ISP docs, I'll take a look.
Copy linkTweet thisAlerts:
@CarolWauthorApr 08.2005 — Give a link to your ISP docs, I'll take a look.[/QUOTE]

Apparently the docs aren't available to non-customers! I tried reaching them without logging in, and couldn't. I'll ask if I may post them, or, alternatively, email them privately.

MAILIT is a proprietary web gadget written by Islandnet's owner, Mark Morley (his brother Steve Morley is the other owner). The Morleys do their own programming. Mark said the MAILIT source code is unavailable. Seems to me the docs wouldn't reveal anything, but I'll ask.

Meantime, I think there's no problem quoting a small portion of the docs - the paragraph that covers the template arrangements. So here it is:

*** short quote from Islandnet docs on MAILIT ***

Controlling the Output Format

By default the mail message you receive is simply a list of all the form variables, followed by their values, one per line. The date and time, as well as the IP number of the user's computer are included for security. However, sometimes it is nicer to have the results formatted differently. This gadget can pass the data through a template file before mailing it to you, which allows you to format the results your own way. Assuming you have created a template file called "order.tpl", you can use it like this:

<input type=hidden name=template value="order.tpl">

The filename is relative to your "www" directory and can be named anything you want.

*** end quote ***

My test pages (I must change the names; they are so awkward) are here:

http://www.coherentdog.org/remarksbyall.htm

http://www.coherentdog.org/blogdisplay.htm

The output available to visitors is in

blogremarks.db

in my www directory (if you know how, you should be able to download the file; I don't even know how to tell you how to do it, but you might know how. Please feel free to download it.

Fri, 08 Apr 2005 05:00:38
Copy linkTweet thisAlerts:
@FangApr 08.2005 — Don't they give an example of a template file?

You can add a little css to change thing in the mean time.

Add this to codogmain.css:#column2 p {
margin:10px 0;
border:2px solid #390;
background:#bdf;
}
#column2 p i {
font-weight:bold;
}

or something similar.
Copy linkTweet thisAlerts:
@CarolWauthorApr 08.2005 — Hi Fang,

When you jump to the rescue, you are incredibly effective!

Don't they give an example of a template file?

You can add a little css to change thing in the mean time.

Add this to codogmain.css:#column2 p {
margin:10px 0;
border:2px solid #390;
background:#bdf;
}
#column2 p i {
font-weight:bold;
}

or something similar.[/QUOTE]


No, they don't give any example except for that single line, and their code won't validate as XHTML 1.0 Strict, either; that was a sweat for me, to find out how to alter it, but by using the W3C Markup Validation Service, I managed it! (I see I left a comment in the original file that isn't valid; I'm even going to fix that, because I don't trust myself not to make really stupid mistakes).

All Islandnet's docs are that way, sort of, anyway; they have very few examples. They do have local forums where they answer questions sometimes, when they can, and sometimes, those give more detail. But they are programmers, and I think they find it hard to write for people like me.

I had actually asked on the local forums, first, but got no reply. I don't blame anybody for bypassing my questions; I know they are very hard to sort through and answer, largely because I don't know how to ask, with the result that my questions are terribly long and apparently complex. Somehow, though, you seem to manage it!

So now I'll go try your suggestions on the CSS file! Thanks a million!

Fri, 08 Apr 2005 07:56:38
Copy linkTweet thisAlerts:
@CarolWauthorApr 08.2005 — Replying to myself - and to Fang's earlier post:



No, they don't give any example except for that single line, and their code won't validate as XHTML 1.0 Strict, either; [skipping]

So now I'll go try your suggestions on the CSS file! Thanks a million!

Fri, 08 Apr 2005 07:56:38[/QUOTE]


I posted on the Islandnet forums, and got all kinds of help this time. I stil very much need help here, too, but I got pointers to where to find things.

The Islandnet docs *are* available to the public. You can go to

http://www.islandnet.com/

And select Help and Info from the menu, or to:

http://helpdesk.islandnet.com/help/cgis.php

for the docs on the MAILIT (and other) gadgets.

Here's what Islandnet tech support (Kerry) said:

*** quote from Islandnet ***

On Fri, 08 Apr 2005 08:20:42 -0700, in helpdesk.Everything_Web Kerry

wrote:

For what part of the MailIt gadget are you looking for a template?

There are two output components you can format--the "REPLY" and an

optional e-mail response. The REPLY document is pretty

straight-forward, as it's an HTML document where you can insert any of

the MailIt fields you've used in your form. Any place where you

specify a MailIt field is where output will display.

The e-mail response can be formatted by using a template file. The

e-mail template file is pretty straight-forward too, as it's a plain

text file. Like the REPLY document, you can insert any fields you

used in your MailIt form.

If you're enquiring whether you can format the input someone has left,

you can apply formatting to each field but you can't apply formatting

to anything inside the field. For example, even if someone inserted

HTML markup in their response, their response would appear as HTML on

your page and no formatting would apply.

*** end quote ***

I replied saying I'd work with this. I still need to understand it; I don't, quite.

By the way, Fang, I made the style changes you suggested - and put them in a separate CSS file for the page where visitors may enter remarks (now entiteld "blogmake.htm") and on the "reply" page that should display the results, "blogdisplay.htm"). Interesting [big grin]

Now I need to add that also, I have visitor entries emailed to me, so I'll look at those and see if I think I need to "format" them or not. I don't like HTML mail; I avoid it when possible, so I may not need to format those.

Another project that relates to MAILIT:

Eventually, what I want to do is, use this same MAILIT gadget for my Guestbook, so I'm notified when a visitor makes an entry there. But for that, I'm using a different Islandnet script; that one reverses entries - that is, after the entry is made, it locks the file, reverses the order somehow, re-opens the file, so the entries appear with the latest first, and the others in descending order.

Fri, 08 Apr 2005 14:25:07
×

Success!

Help @CarolW spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...