Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Thanked 0 Times in 0 Posts

    Help With What May Be A Simple Calculation Error


    I was given a cgi/perl script the other day and in running the script and
    it's components everything worked fine when I installed it on my Linux server. However, the end result is that the add message feature keeps multiplying the message number on the URL (which is used to access the message that has been saved).

    I am a PRE-Newbie and have yet to even begin tutorials, but the code and it's package was given to me and I'd like to make the most of it. I think I've placed in the code where the problem is happening, but because I do not know/code perl, i do not know how to remedy it.

    In my search to find answers I've come upon some cgi/perl tutorials - but I
    simply can't at this time, wait for this problem to be solved as I am supposed to be offering it shortly.

    Would you be able to take a look at the code and advise me?

    I think the problem has something to do with the calculations... either the ++2 or the [#] relat=ed to the message number commands.

    I have attached an image of what the resulting code looks like when it is running on the Linux server.

    *this is the section where I believe the problem is happening:

    PHP Code:
    FILE>) {push(@periods,$_)}
    opendir(DIR,"@_[0]") || die "Cannot open $userdir!";
            while (@
    files=readdir(DIR)) {
                    if (
    $file ne ".." && $file ne "." && $file ne "" && $file=~/letter\d*\.txt/) {
    listing=sort blia @list1;
    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";
                        if (
    $pattach ne ""){
    " with attachment: <font color='red'>$pattach</font> ($size bytes)</p></td></tr>";
                        } else {
        if ($
    print "<tr><td><p>You have no letters!</p></td></tr>";
        } else {

    print "</table>";
    "<input class='edit1' type='image' src='".$imgpath."/add_message.gif' value='Add New Message' onclick=\"document.letters.mode.value='newlet'\"> <input class='edit1' type='image' src='".$imgpath."/save_intervals.gif' value='Save Intervals' onclick=\"document.letters.mode.value='saveletter'\"><br><br>\n";
    "<table width='100%' border='0' cellspacing='0' cellpadding='0' background='".$imgpath."/bg.gif'><tr><td><img src='".$imgpath."/poloska.gif'></td></tr></table>\n";
    " <p><b><u>Prospects</u></b><br>Do you want to add new contacts to your 'active prospects' list?<br>Just insert their names and addresses below in the following format:<br><b>John Smith|john\@email.com</b><br>or:<br><b>john\@email.com</b><br>(one address per line)<br>Import prospects into sequence beginning with <b>message number</b> <input class='edit1' name='period' size='2' value='1'></p>\n";
    " <textarea class='edit1' rows='8' name='import' cols='50'></textarea><br>\n";
    " <input class='edit1' type='image' src='".$imgpath."/import.gif' value='Import Prospects' onclick=\"document.letters.mode.value='saveletter'\"> ";
    " <input type='image' src='".$imgpath."/export.gif' onclick=\"window.open ('$scripturl?mode=export&ar=$FORM{'ar'}&password=$FORM{'password'}', 'newwindow', config='height=500, width=400, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no'); return false;\"><br><br>\n";
    "<table width='100%' border='0' cellspacing='0' cellpadding='0' background='".$imgpath."/bg.gif'><tr><td><img src='".$imgpath."/poloska.gif'></td></tr></table>\n";
    " <input type='hidden' name='ar' value='@_[0]'><input type='hidden' name='mode'>\n";
    "  <input type='hidden' name='newone' value='$numb'>\n";
    "  <input type='hidden' name='password' value='$FORM{'password'}'>\n";

    I am willing to pay for the fix.
    Your help is appreciated.

    Attached Thumbnails Attached Thumbnails -au-messagenumerror-png  


Posting Permissions

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