dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: This CGI script is KILLING me!

  1. #1
    Plutarian(From Pluto, stupid!) kitchee's Avatar
    Join Date
    Aug 2001
    Posts
    438
    Ok here it is.
    There is a major problem.

    The program basically pulls the text file into Flash for editing. The text file has 7 variables. One for each text section on the site.
    The interface I made pulls them into dynamic input text boxs so you can edit them at anytime in a site admin section.

    Now the NEW problem is...is that when trying to write to the text file it turns all the variables blank!!!

    So in the text file I start with:


    Code:
    Text1=Blurp&Text2=Blurp2&Text3=.....

    When I get done editing it it looks like:

    Code:
    Text1=&Text2=&Text3=&Text4=&Text5=&Text6=&Text7=

    Why is this happening? Why is it erasing my info completely?

    Could it be a chmod problem?

    Here is the scripts I am using..
    NOTE:There is a parse form also...


    Code:
    #!/usr/bin/perl
    
    require "subparseform.lib";
    &Parse_Form;
    
    $Text1 = $formdata{'Text1'};
    $Text2 = $formdata{'Text2'};
    $Text3 = $formdata{'Text3'};
    $Text4 = $formdata{'Text4'};
    $Text5 = $formdata{'Text5'};
    $Text6 = $formdata{'Text6'};
    $Text7 = $formdata{'Text7'};
    
    @New =  ("Text1=$Text1&Text2=$Text2&Text3=$Text3&Text4=$Text4&Text5=$Text5&Text6=$Text6&Text7=$Text7");
    
    open (LOG, ">/home/sites/site5/users/MYUSERNAME/web/Ex2TextFile.txt") || &ErrorMessage;
    print LOG "@New";
    close (LOG);
    
    
    print "Content-type: text/html\n\n";
    print "Status=Success - Your Comments have beed updated. Please return to the main area to see the results";
    
    sub ErrorMessage {
    	print "Content-type: text/html\n\n";
    	print "Status=Connection Failed Please Check the path to the text File";
    	exit;
    }
    Can someone please give me some idea as to what is happening?
    The server will not let me set the CGI files to anthing hight then 755, is that a problem?

    I've trie a few differant chmods and still nothing...

    I uploaded all the files in ASCII mode and set the txt file to 777 and the cgi files to 755.

    HELP!!!!!

    k

  2. #2
    Banned indivision's Avatar
    Join Date
    Jul 2001
    Location
    Portland, OR
    Posts
    474
    i dont think its a chmod problem. sounds like the variables arent getting into the script. how are you calling this script?

  3. #3
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi Kitchee,

    if this is on a public server, please post url to your movie.

    Musicman

  4. #4
    Plutarian(From Pluto, stupid!) kitchee's Avatar
    Join Date
    Aug 2001
    Posts
    438
    Ok here is the sample I'm using, it's not finished but it should work:
    http://www.cyber-on.co.uk/AdminTest.htm

    I do a normal loadvar and that works fine..
    When you click edit all it does is change the text boxes to input boxes so you can edit the text. When you hit "save changes", this code is run to start the cgi script:

    Code:
    on (release) {
        // This just calls up the Perl Script - Executes it, prints back a status message - That's it
        loadVariablesNum ("http://www1.hostabc.com/~THESITENAME/cgi-bin/UpdateVars.cgi", 0, "POST");
        Status = "Updating Variables - Please Wait till you see the Update Success Message";
        gotoAndPlay (35);
    }
    This address was given to me by the tech support. They said that this is the proper way to call up a cgi script on thier servers.

    It's seems now that the script is not connecting? It connects fine when I do a (control+enter) in flash but now that it's on the server nothing?

    Does anyone see a problem here?

    BTW: The name/password to test it is"
    Name:cyber-on
    PW:tony

    Here is the documentation I got from tech support on cgi files:

    Your scripts must be made executable for them to work. You
    can do this in most FTP programs.

    For example, in WS_FTP:
    Select the file and right click.
    >From the pop-up menu select: CHMOD
    Click the check boxes as follows:

    Owner Group Other
    Read Read Read
    Write
    Execute Execute Execute

    Click OK. The log window of WS_FTP should say something like:
    SITE chmod 755 script.pl
    200 SITE CHMOD command successful

    You should never click all the boxes, which is the equivalent
    of CHMOD 777. We run periodic checks on files set to CHMOD
    777 and any that we find may be deleted.

    To use CGI scripts you must use a path to the script of:
    http://www1.hostabc.com/~user1/script.pl

    For example, if your username is joebloggs and your script is
    called formmail.pl, which is located in a cgi-bin directory
    the action statement for calling the script might be:
    <FORM METHOD="POST" ACTION="http://www1.hostabc.com/~joebloggs/cgi-bin/formmail.pl">

    If you use /cgi-bin/formmail.pl to call the script you may get
    permission errors when you try to run it. This only applies to Silver
    Package web space. Gold Package customers *can* use the format
    of /cgi-bin/formmail.pl.


  5. #5
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi kitchee,

    this will NOT work due to Macromedia's security policy. However, the text from the server people creates the impression that the formmail may be under your control (although I would not believe that).
    In any other case your options would be to convince the server people that they should offer a flash-friendly solution (http://www.yoursite.com/cgi-shared/formmail.pl), to put some gold on your silver surfer, or to get some free cgi space in addition to what you have already

    Musicman

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center