Click to See Complete Forum and Search --> : Cant find error on auto Mail , ??someone??
This should mail automaticly to the users ho lives a message on my guestbook , but the hell, I cant find the error...thx for your help ????
$mailto..is my mail...
$FORM{'email'}") is the mail from the users ho lives a message...
-------------------------------
if ($mail eq '1') {
open (MAIL, "|$mailprog $FORM{'email'}") || die "Can't open $mailprog!\n";
print MAIL "Reply-to: $mailto ($mailto)\n";
print MAIL "From: $mailto ($mailto)\n";
print MAIL "Subject: Entry to SR Guestbook\n\n";
print MAIL "$FORM{'name'} <$FORM{'email'}> Thank you for leaving a message on ouer Guestbook, we hope to see you soon on one of ouer EVENTS !! ...\n";
print MAIL " - $date\n";
close (MAIL);
}
asch
:D
jeffmott
05-28-2003, 08:38 AM
open (MAIL, "|$mailprog $FORM{'email'}") || die "Can't open $mailprog!\n";Although there may be some mail programs that form the "To" header from a command line argument, most do not and the one you may be using now may not either. $FORM{'email'} should be taken out of this line, and add to your printed headersprint "To: $FORM{'email'}\n";
:) Sup... number one jeff...thx
it seams to that you are pretty good..so I have another question :o) ?
know my guest works okay but the problem is that it can print 1000 of messages on the same page, is it possible to put an max of 10 messages on the same page, an with an automatisation of the links to navigate...
is it complicated ??how would I do that ?
hmmm the main problem is how to make a counter...?
actually I print it on the page like this :
---------------------
for ($i=0;$i<=$SIZE;$i++) {
$_=$LINES[$i];
if (/<!--add-->/) {
blablablablabla
else
blabla
}
close
------------------------
thx for your help!
asch
jeffmott
05-31-2003, 08:29 AM
To have posts move between pages, it is actually easier to generate the "view guestbook" page dynamically, instead of writing to a static page. You can then choose to return only the post in the range
Page * MessagesPerPage .. (Page + 1) * MessagesPerPage - 1
hmmm okay il try it thanx a lot...
asch..
:D
jeffmott
05-31-2003, 11:19 PM
hmm, I didn't elaborate very much did I? The kind of guestbook you have now, when a new post is received it is written to an HTML document on the server. It can be very difficult to make modifications to this later, such as moving posts from one page to another. So intead, when a new post is received it is stored in a database, usually keyed by a number: a PostID. So now to view the guestbook, the CGI script would read the necessary posts from the database to dynamically build an HTML page that is returned to the user. Given a page number (the page number will probably have to be zero indexed as far as the script is concerned) and the number of messages you want to appear on each page, the simple formula I gave earlier can be used to loop through the PostIDs to be retrieved from the database and returned to the user.
For example, if Page is 0 and MessagesPerPage is 10, you'll get
0 .. 9
very nce explanation :O)....
i have started to work on it, i went in the rong way ...
i l try it in your way ...
well i m sure i m gonna get some troubles, while editing this thing ;), so when I m a bit further in the programming...
i lknow a bit more...and have some nce questions ....lol
thx
asch
:D