HTML help please : Lunch decider

Bruck

Senior member
Aug 6, 2003
381
0
0
I am looking to write an html page, or a simple program ( i dont have programming skills) to do a simple task for me. Basically i want to create 2 edit-able data files.

file1 = list of places that we can eat at
file 2 = email list


the program will do the following:

step 1) Randomly choose a place for lunch today
step 2) When pressing the OK button, it will send a scripted email to everyone in the list, or atleast launch the email in outlook so i can finish writing it, edit it , explain bla bla.....
step 3) If i hit no, the page/program would re-generate a new place to eat at.


Thanks,

Is this possible in html?
 

Codewiz

Diamond Member
Jan 23, 2002
5,758
0
76
Not straight up HTML. But you could use either Client side javascript or server side scriping such as ASP or PHP.
 

DannyBoy

Diamond Member
Nov 27, 2002
8,820
2
81
www.danj.me
Originally posted by: Bruck
I am looking to write an html page, or a simple program ( i dont have programming skills) to do a simple task for me. Basically i want to create 2 edit-able data files.

file1 = list of places that we can eat at
file 2 = email list


the program will do the following:

step 1) Randomly choose a place for lunch today
step 2) When pressing the OK button, it will send a scripted email to everyone in the list, or atleast launch the email in outlook so i can finish writing it, edit it , explain bla bla.....
step 3) If i hit no, the page/program would re-generate a new place to eat at.


Thanks,

Is this possible in html?

That my friend is not a "simple" as you put it task if you know nothing about any form of programming whatsoever.

As has been said it would require a technology such as php
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
This is generally close to correct, I haven't tried it, it could have bugs:

#!/usr/bin/perl

use Net::SMTP;

# Find a lunch place
open LIST, "listoflunchplaces.txt";
my @list = <LIST>;
close LIST;
$pick = int(rand(@list));

# Get the email addresses
my $email = "To: ";
open EMAIL, "listofemailaddresses.txt";
while(<EMAIL>){$email .= "$_, "}
close EMAIL;
$email .= "n";

# Create a message
my $message = "Let's go to lunch at $list[$pick]";

# Send the email
my $smtp = Net::SMTP->new('localhost');
$smtp->mail("$from");
$smtp->to("$to");
$smtp->data();

$smtp->datasend("To: $email\n");
$smtp->datasend("From: you@yourdomain.com\n");
$smtp->datasend("Subject: Lunch\n");
$smtp->datasend("\n");

$smtp->datasend("$message");
$smtp->dataend();
$smtp->quit;