Lunarpages Web Hosting Forum

Author Topic: How do I add date/time to Formmail?  (Read 1029 times)

Offline FST2005

  • Spaceship Captain
  • *****
  • Posts: 111
How do I add date/time to Formmail?
« on: January 27, 2005, 04:41:30 PM »
Hello,

I have to first say that someone should really spend the time and write a detailed Tutorial on adding the Formmail to cgi folder.

I followed the directions from http://www.lunarforums.com/forum/viewtopic.php?t=18221

but being how I'm not a person who codes alot, still was a bit hard. It would make things alot easier for Lunarpage Customer's if it was put together, in a step by step.

OK, My problem or question is on being able to add a (time,date) stamp to the "re-direct"web page after they hit submit. Meaning, after the person adds their info, and clicks submit, I would like  to have another screen load with a date and time stamp on it.

When explaining, please try and give me a step by step. I read somewhere on this forum about how to do this, but could not figure out where the "NEW" code should be entered into. I was not able to follow their directions.

PS: from what I have read , leighsww seems to know alot about how to fix this kind of thing, so if you "leighsww" read this, you do explain how to fix most problems really well, but assume I'm really dumb and please explain as much as you can...please.

Thanks for all the help,
Mike S
Brian K
Front Street Trading
Your Clothing Bargain House
Email: fstrading@frontstreettrading(NOSPAM).com
http://www.frontstreettrading.com

leighsww

  • Guest
How do I add date/time to Formmail?
« Reply #1 on: January 27, 2005, 05:19:17 PM »
You really wouldn't be touching any of the codes after the 'CONFIGURATION' portion that I explain in my tutorial. I'm afraid you really can't get anymore step-by-step than what I gave, because again ... you shouldn't be touching anything else in the script if you don't know how to code perl.

I, myself, to be honest, cannot code perl (which is what the NMS FormMail script is coded in), so I just follow basically the README file that the script puts out already.

I've come to be able to figure certain things out with the coding to customize a few things, but not much more than a "few" things.

The redirect page is html, so if you want a time stamp to show up there, then you probably have to make that page with PHP or something that can capture that info.

The only place right now where you get a time stamp is on the email that gets submitted to you. However, it is set to default to wherever the server is at and not your time zone. If you want to change that to your timezone, I recently found where that is:

Code: [Select]
sub default_configuration {
  return (
    allow_empty_ref        => 1,
    max_recipients         => 5,
    mailprog               => '/usr/lib/sendmail -oi -t',
    postmaster             => '',
    referers               => [],
    allow_mail_to          => [],
    recipients             => [],
    recipient_alias        => {},
    valid_ENV              => [qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT)],
    date_fmt               => '%A, %B %d, %Y at %H:%M:%S',
    date_offset            => '-10',
    no_content             => 0,
    double_spacing         => 1,
    join_string            => ' ',
    wrap_text              => 0,
    wrap_style             => 1,
  );


However, this coding portion is like somewhere in the middle of the script. You would change the "date_offset" to GMT applicable to your timezone. I have set the above sample to Hawaii timezone, so you have to set yours to whatever yours would be.

The only thing I caution you with ... if you do not know what your are doing, then best you DO NOT touch the script. If you want me to go in and change it for you, then PM (Private Message) me the following:

1) your domain name
2) your username and password
3) the GMT time applicable to your timezone (I am not going to try to figure it out, so you must supply me with that bit of info :D )

You can change your password when I'm done.

leighsww

  • Guest
Re: How do I add date/time to Formmail?
« Reply #2 on: January 27, 2005, 05:25:21 PM »
Quote from: FST2005
I read somewhere on this forum about how to do this, but could not figure out where the "NEW" code should be entered into. I was not able to follow their directions.

Please point me to the thread you are referring to regarding this. Thanks.