#1
  1. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    stuttgart
    Posts
    4
    Rep Power
    0

    Question Flash, CGI and 403 Errors


    Hi there,
    has anyone any experience using a contact-form out of a running swf-file - i know the syntax and it works almost 100%, but
    there are a few internetusers who get a 403-errror-page when calling the cgi-script out of the flash-file.
    has anyone an idea, why they get the 403 (forbidden)- page?

    grateful for any help,
    pixelle
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    Provo
    Posts
    36
    Rep Power
    12
    Do you have any sample code that you could post.... code that is causing the problems??
  4. #3
  5. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    stuttgart
    Posts
    4
    Rep Power
    0

    code for swf and cgi


    sure,

    i am using this code on a submitbutton in the flashfile:

    on (release) {
    getURL ("http://www.fantastic-sports.net/cgi-bin/fsformmail.pl", "_blank", "POST");
    }

    there are some text-fields like
    recipient:
    info@fantastic-sports.net
    subject and so on (equivalent to hidden fields, you know?)

    then for the cgi i use Formail from http://www.scriptarchive.com/
    i just copy the first part of it, but the problem should not be the "formail.pl" (which is chmoded properly 755)

    thanx for helping,
    pixelle

    here the first part of the formmail.pl:


    #!/usr/bin/perl

    ##############################################################################

    # FormMail Version 1.92 #

    # Copyright 1995-2002 Matt Wright mattw@scriptarchive.com #

    # Created 06/09/95 Last Modified 04/21/02 #

    # Matt's Script Archive, Inc.: http://www.scriptarchive.com/ #

    ##############################################################################

    # Define Variables #

    # Detailed Information Found In README File. #



    # $mailprog defines the location of your sendmail program on your unix #

    # system. The flags -i and -t should be passed to sendmail in order to #

    # have it ignore single dots on a line and to read message for recipients #



    $mailprog = '/usr/lib/sendmail -i -t';



    # @referers allows forms to be located only on servers which are defined #

    # in this field. This security fix from the last version which allowed #

    # anyone on any server to use your FormMail script on their web site. #



    @referers = ('fantastic-sports.net','fantastic-sports.com','eurobungee.de');



    # @recipients defines the e-mail addresses or domain names that e-mail can #

    # be sent to. This must be filled in correctly to prevent SPAM and allow #

    # valid addresses to receive e-mail. Read the documentation to find out how #

    # this variable works!!! It is EXTREMELY IMPORTANT. #

    @recipients = (&fill_recipients('fantastic-sports.net','fantastic-sports.com','eurobungee.de'),

    '^info@fantastic-sports\.net');



    # ACCESS CONTROL FIX: Peter D. Thompson Yezek #

    # @valid_ENV allows the sysadmin to define what environment variables can #

    # be reported via the env_report directive. This was implemented to fix #

    # the problem reported at http://www.securityfocus.com/bid/1187 #



    @valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT');



    # Done
    Last edited by pixelle; January 31st, 2003 at 02:47 AM.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    Provo
    Posts
    36
    Rep Power
    12
    K. I give up. I haven't spent too much time thinking about it, but nothings poppin into my head right away... sry!

    The only other thing I can think of is that it's not Flash.... and that's easy to test.. have the same clients who get the 403 error load the ~exact same~ URL into IE.. and see what happens.
  8. #5
  9. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    stuttgart
    Posts
    4
    Rep Power
    0

    Unhappy what u mean?


    sorry, do you mean i should copy this line
    http://www.fantastic-sports.net/cgi-bin/fsformmail.pl
    into a browsers-adress-field?
    because, if i do, i get an 403 myself, though the script worked fine on my comupter so far.

    i really have no idea, where the error could be...

    pixelle
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    so the script does work if YOU access it, but not for some others.
    the script wants to have a referrer for blocking spammers from using it (as if this would help...)

    i guess they have broken browsers or setup some "personal firewall" or webwasher or something that removes the referer. their fault, not yours. 1000s of other pages won´t work either for them.

    you could modify the script:
    1. line:
    if ($ENV['HTTP_REFERER']=="") { print "Your browser did not transmit a referer. Sorry, you cannot use this feature."; die(); }

    though i am not 100% sure about the "$ENV". could be "%ENV" or something. if you want to go this way, ask in the perl forum how to read the HTTP_REFERER from a perl cgi. They´ll know the answer.
  12. #7
  13. Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    stuttgart
    Posts
    4
    Rep Power
    0
    thanx for helping,
    i just found out what is happening:
    the script is working only on macs - not on pcs, BUT
    only on the server of one provider - i put the script on a different
    server (of another provider, though both are using the same apache
    server) and now it works!
    weird.

IMN logo majestic logo threadwatch logo seochat tools logo