SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    FormMail.pl - Want last_name to appear in subject line.

    I've set up FormMail and it's working great. But, I realize I'd like my contact's last name to appear in the subject line, so that I can see at a glance who sent what.

    I'm not a coder, but I can generally figure things out. This seems to me that it must be really simple, but I need some guidance this time.

    (input type=hidden name="subject" value="Business Contact")

    How would I add the last_name variable to that?

    Any help appreciated!

    M

  2. #2
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Sheesh, wondered what you meant... formmail.pl is a typical name for a formmail script...

    but do you mean the FormMail.pl from Matt's Script Archive?

    In any case, usually when people are submitting information in hidden form inputs, the value is holding what you want to add to the form. If you need both "Business Contact" and "Smith" then it would make sense that you'd need two hidden inputs... as many hidden inputs as necessary.

  3. #3
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for responding! Yes, Matt's FormMail. (It was already installed by my host, so I didn't look any further.)

    My problem is that I don't know how to add that extra value to the Subject line. I've tried all sorts of things and nothing seems to work. I get "Business Contact", but when I do get the "last_name" variable, it's just like that. It's not the sender's actual last name.

    If I try putting it on a second line, "Business Contact" is replaced by "last_name".

    I tried separating them, but on the same line, like: (input type=hidden name="subject" value1="Business Contact" value2="last_name")

    My editor program liked that one, but the only part that showed up in the sent email was "Business Contact".

    Separating the two with a comma, I do get both items, but no matter what, I can't get the actual person's last name.

    Is there a good, EASY tutorial somewhere for using FormMail, with lots of variable info?

    Thanks!

  4. #4
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Well, first thing to know is, Matt's Script Archive was written in the heady days of old Perl over a decade ago by someone who was still learning himself, in high school. There's been an update of his stuff (start reading here and I'd strongly suggest having Good Perl rather than bad old Perl : ) There's a formmail.pl over there.

    And, when doing testing, always use strict and use warnings... let the program tell you when you screw up!

    For values, value1="x" value2="y" shouldn't be valid HTML anyway... inputs get only one value. Normally it would be two inputs OR one value like value="Business Contact: $varforlast_name". Or, the program would have to look at the value of the field that actually asked for the customer's last name, and add that to the script (rather than sitting in a hidden input). I don't know what your form is or how people are interacting with it.

    Since you aren't actually getting the value, you'll want to post the code you're using because we would need to see how you are dealing with $last_name. Though in all seriousness first I'd switch scripts. Oh, and I don't do Perl (yet... started it then had to quit for a while).
    So, you'll want to post the HTML form and the perl code. I'm not sure but I don't think this formmail is like PHP's FormMail where everyone uses the same script so everyone knows what the code is.

    Also, what version of Perl is running on your server? Don't tell me it's 5.006 or something : )

  5. #5
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Ah...

    I'm updating the (outdated) Perl resources sticky here and since I don't know when the update will be posted...
    At the link I posted above, there should be a readme in the TFMail on the programs page. (I'm not on my computer so I don't want to dl the zip to find out)

    You may want some general Perl tuts:
    http://affy.blogspot.com/p5be/ch00.htm (Perl 5 by Example)
    http://perlmonks.org/?node=Tutorials (tutorials @ PerlMonks, which btw is also a place to ask n00b questions... don't be put off by how ugly and old the site looks : ) it's very active)

    There are some more but you may be just trying to get form mail working and move on to other things, I don't know. : )

  6. #6
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks so much!!

    I'm pretty sure I saw at least one other form mail script on the server, so I'll see what's there to use instead. I hate to upload new scripts -- I always seem to make some dumb mistake (like forgetting to upload in ascii, or setting wrong permissions) and then spiral downward as I try to figure out why it doesn't work.

    I hadn't realized that about Matt! I used his message board for years before finding another that didn't have issues with cross-posting and spontaneous combustion. I was constantly fixing it. Suppose I should have known better!

    This is actually for a client, though I do need to set up form mail pages for myself and others after this. These days, most of my 'clients' are freebies (friends and my husband's bands), so they aren't picky, but I do want to put out a better product in case someone actually wants to pay me. ;o) Basically, I'm a graphics person, not a coder, so I need all the help I can get in this area!

    I'll check out your links later tonight. Again, thanks so much for your help!

  7. #7
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,272
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    If the links don't get you anywhere and you cannot get rid of the nasty old script (since you said it's on your hoster), post the relevant code here anyway (the HTML form and the Perl). Anyone who does know basic Perl should be able to spot the issue right away.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •