RE: Cold Fusion advice/help needed

by "Missy Scott" <MBScott(at)d-assistance.com>

 Date:  Tue, 28 Aug 2001 11:47:53 -0400
 To:  "'Michael Wilson'" <mwilson(at)xionmedia.com>,
<hwg-techniques(at)hwg.org>
 In-Reply-To:  PC1
  todo: View Thread, Original
Mike,

Would you mind if I had "CF_Tard:)" printed on a t-shirt?

I admitted it... I AM a CF_Tard.  Hence the question.  Although,
<.snip>
As far as your code is concerned you should expect none, however they
should give you the info you need to get a Datasource set up and tell
you what custom tags they allow and etc...
<./snip>

I think the problem is not that I'm not willing to learn and explore CF.  I
am.  However, we are talking about a host that won't take phone calls, let
alone help me get a datasource set up and tell me what custom tags they
allow.

What I didn't know is if I was being "unprofessional" or if they were.  For
example, I know if I'm going to use Technology X, and Technology X requires
the host to set up something, I know what to expect from the host.  But if
I've never worked with Technology X, I don't know what to expect from the
host.

Since the form has a GREAT number of entries, it would be nice to write it
right to a database, but I also would like to see how many submissions we
get.  I mean, this is a somewhat specialized little survey... not everyone
that visits the site is even qualified to fill it out.

The fact regarding my Perl question is that they once told me it was
installed, but no one could tell me the path.

Anyway, I do believe I will tell the client that she has to have a CF
developer OR change hosts and see what happens.  I don't mind delving into
CF and learning what I can, but I really don't feel I should do that on the
client's time.

Thanks to you all for helping out... I appreciate the information and
support.


Missy
The CF_Tard!

-----Original Message-----
From: owner-hwg-techniques(at)hwg.org
[mailto:owner-hwg-techniques(at)hwg.org]On Behalf Of Michael Wilson
Sent: Tuesday, August 28, 2001 10:24 AM
To: MBScott(at)d-assistance.com; hwg-techniques(at)hwg.org
Subject: RE: Cold Fusion advice/help needed


Hi Missy,

It is really quite simple to accomplish this with ColdFusion.

First: Create your, form.cfm as you have already done. Note the action
line and the hidden field line at the top in the example below.

Note the email input -- this is required by ColdFusion. If for some
reason you don't want to have it required on your form, make it a hidden
field and give it a value of something like form(at)submission.com.

<html>
<head>
<title>title</title>
</head>
<body>
<form name="myform" method="post" action="formaction.cfm">
<input type="hidden" name="subject" value="Survey Submission">

<p>Name:</p>
<input type="text" name="Name" size="20">

<p>Phone:</p>
<input type="text" name="Phone" size="20">

<p>Email:</p>
<input type="text" name="Email" size="50">

<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</form>
</body>
</html>

Second: Create your formaction.cfm, which tell the ColdFusion Server
what to do with the form fields you just passed to it and allows you the
opportunity to thank your visitor for submitting the form.

Note the line at the top of the script. This line tells ColdFusion to
grab a "custom tag" called MailForm, read it and "follow it's
instructions" so to speak. Custom tags are stored either in the current
directory or under the "customtags" directory. You call them using the
CF_ prefix. Beyond that, you are free to use any naming convention that
fits your development practice. Just remember to rename your custom
tag.cfm if you alter the way you call it. This line also tells CF where
to send the mail TO and what the SUBJECT of the message is.

<CF_MailForm TO="youremail(at)yourdomain.com" FROM="#FORM.email#"
SUBJECT="#FORM.subject#">

<html>
<head>
<title>title</title>
</head>
<body>
<table>
<tr>
<td>
Thank you for submitting the survey... blah blah blah...
</td>
</tr>
</table>
</body>

Third: You will need to grab MailForm.cfm custom tag and put it in the
same directory as form.cfm and formaction.cfm. The ColdFusion engine
first searches for a custom tag in the directory of the calling template
(aka page). This allows you to keep a custom tag file in the same
directory as the page that uses it. You do not need to make any changes
to MailForm.cfm, just put it in the same directory as the "form files"
and ColdFusion will do the rest.

I will post MailForm.cfm at http://www.xionmedia.com/hwg/mailform.zip
for you to download.



> Do Cold Fusion hosts offer Perl?

CF is just an add-on to a regular windows box... or just about any other
box for that matter. Perl can be installed as usual.

> Of course, what I know about Cold Fusion could fit on the
> head of a pin.  In looking at the shorter form, I could
> figure out how to make a longer one, but I'm not sure about
> the Datasource.

Errr... Are they posting the results to a database? If so it get just a
little more complicated, but not too bad. You need to find this out
before you begin working on the formaction.cfm. It may require that you
also include a SQL statement in the template...


> I suppose I would need to know what kind of
> database to use.

You don't HAVE to use a database. CF can just send the email... Of
course the database would be useful for keeping records and such. You
can use any ODBC compliant database with CF.

> I'm hoping she'll
> change her mind on changing hosts, but I'm not holding my breath.

If I were you I would use my access to this server to learn a little
ColdFusion, lol.

> My question, I think, is this:  how much support should I
> need from the host for CF?

As far as your code is concerned you should expect none, however they
should give you the info you need to get a Datasource set up and tell
you what custom tags they allow and etc...

> Should I be able to just upload a
> database and write to it?

Nope. You will more than likely have to request that the host add a
Datasource name (DSN) to the CF Server for you. A Datasource name is
like a pointer to a database. Then you can reference to the database by
using Datasource="mydatasource"

> Am I being obtuse or am I just
> being dumb about CF?

CF_Tard :]

> In other words, I don't know if I'm stupid or if they are stupid.

It sounds to me as if you are CF Illiterate and they have forgotten how
to speak HTML.
Be sure to let them know you don't have the first clue about CF and
maybe they can give you some pointers.

Good luck!,

Mike

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA