Jump to content
xisto Community
Sign in to follow this  

Need Help With An Autorespoder Script heres a snippet of the code...

Recommended Posts

i have two messages in my auto responder and the output is supposed to be:

but i keep getting the output:

can someone help me by just looking at this part of the code? I don't know cgi and don't want to screw up the code with trial and error.

periods.txt is the file that tells when to issue each message. if there are two messages like i have, there will only be two values in that file:

in my web folder, i have

print "<p><b><u>Edit Messages</u></b></p>\n"; print "<table>\n";	open(FILE,"$FORM{'ar'}/periods.txt");		flock(FILE,$LOCK_EX);		foreach(<FILE>) {push(@periods,$_)}	close(FILE);	@periods[0]=0;	$numb=0;	opendir(DIR,"@_[0]") || die "Cannot open $userdir!";		while (@files=readdir(DIR)) {			foreach $file(@files){				if ($file ne ".." && $file ne "." && $file ne "" && $file=~/letter\d*\.txt/) {					push(@list1,$file);					@listing=sort blia @list1;					@listing[$#listing]=~/(\d+)/;					$num=$1;					if($numb>$#periods){@periods[$numb]=@periods[$numb-1]+1};					print "<tr><td><p><a href='$scripturl?mode=read&fname=@listing[$#listing]&ar=@_[0]&num=$1&password=$FORM{'password'}'>Message $num</a></p></td><td><p> sent after <INPUT class='edit1' name=@listing[$#listing] size='5' value='@periods[$numb]'> days";					($pattach)=getattach("$FORM{'ar'}/@listing[$#listing]");					$pattach=~/.*\.(.*)$/;					if ($pattach ne ""){						$size=-s "$FORM{'ar'}/upfile$num.$1";						print " with attachment: <font color='red'>$pattach</font> ($size bytes)</p></td></tr>";					} else {						print "</p></td></tr>";					}					$numb++;				}			}		};	close(DIR);	if ($#listing==-1){		print "<tr><td><p>You have no letters!</p></td></tr>";	} else {	};	$newlet=$#listing+2; print "</table>";

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.