how come i cant pass value from html to perl? And cant print html from perl script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #16
    I have confirmed that my script is at d:/cgi-bin which the perl script upload.pl resides
    the script should be in the cgi-bin folder that is in the apache folder in the web root folder. Not sure what its all called with your version of apache, but generally something like:

    c:/blahblah......a pache/htdocs/cgi-bin

    and your html file would be in the htdocs folder, which is the web root folder which is localhost (127.0.0.1). Now your version of apache might not be exactly like that so you may need to determine which is the web root folder.

    So you start apache, then open a web browser and enter in the address box:

    http://localhost/yourpage.html

    where yourpage.html is the html document with the form code.

    Comment

    • happyse27
      New Member
      • Sep 2008
      • 236

      #17
      Hi Sir,

      Thanks.! I think I got closer, because i placed testing.html under directory
      D:\Program Files\Apache Software Foundation\Apac he2.2\htdocs

      and upload.pl under directory
      D:\Program Files\Apache Software Foundation\Apac he2.2\cgi-bin

      When i type http://127.0.0.1/testing.html, I CAN SEE the html input form NOW :)) THANKS. However, I CANT call the script as the website http automatically pointed to http://127.0.0.1/cgi-bin/upload.pl now.

      It gives apache error 403, I checked the folder D:\Program Files\Apache Software Foundation\Apac he2.2\cgi-bin again and again it is READ-ONLY :| , although I can copy script into it, I cant run the script as it is read-only(not sure is this the problem, definitely getting nearby, but cant pinpoint exactly where wrong...

      Getting closer. Thanks again Sir...


      Andrew

      Comment

      • happyse27
        New Member
        • Sep 2008
        • 236

        #18
        ANY IDEA why the apache still cant pass the variable into perl script? Thanks in advance... Kindly assist. Cheers...

        Comment

        • KevinADC
          Recognized Expert Specialist
          • Jan 2007
          • 4092

          #19
          403 means the document can't be found. If the html file is in the htdocs folder and the perl script (upload.pl) is in the cgi-bin folder (that is itself in the htdocs folder) and the action of the form is action="cgi-bin/upload.pl" then I don't know why it is not working. When I check the property of a perl script on my Windows computer its "archive" and the script runs fine. I changed it to read-only and it still worked fine. Are you sure the perl script is in the correct cgi-bin folder? (htdocs/cgi-bin) and the name is upload.pl?

          Comment

          • happyse27
            New Member
            • Sep 2008
            • 236

            #20
            Originally posted by KevinADC
            403 means the document can't be found. If the html file is in the htdocs folder and the perl script (upload.pl) is in the cgi-bin folder (that is itself in the htdocs folder) and the action of the form is action="cgi-bin/upload.pl" then I don't know why it is not working. When I check the property of a perl script on my Windows computer its "archive" and the script runs fine. I changed it to read-only and it still worked fine. Are you sure the perl script is in the correct cgi-bin folder? (htdocs/cgi-bin) and the name is upload.pl?
            Hi Sir,

            Yes, the upload.pl script resides in D:\Program Files\Apache Software Foundation\Apac he2.2\cgi-bin. I can show some output using http://127.0.0.1/cgi-bin/upload.pl

            However I could not find this directory htdocs/cgi-bin at all... D:\Program Files\Apache Software Foundation\Apac he2.2\htdocs is what I found which contains apache default html file index.html and I put testing.html in it which I can link using http://127.0.0.1/testing.html

            Any else I needed to set correctly?


            Thanks in advance,
            Andrew

            Comment

            • Icecrack
              Recognized Expert New Member
              • Sep 2008
              • 174

              #21
              1. make sure your .html files are in:

              D:\Program Files\Apache Software Foundation\Apac he2.2\htdocs

              2. make sure your .cgi .pl files are in:

              D:\Program Files\Apache Software Foundation\Apac he2.2\cgi-bin

              3. make sure your action in your html file form is
              [HTML]<form action="/cgi-bin/update.pl" method=post>[/HTML]


              also for your apache config it sure be


              Code:
              ScriptAlias /cgi-bin/ "D:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\"
              
              <Directory "D:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin">
              AllowOverride None
              Options FollowSymLinks ExecCGI
              Order allow,deny
              Allow from all
              </Directory>
              Last edited by Icecrack; Oct 3 '08, 02:25 AM. Reason: Mistake in the dir

              Comment

              • KevinADC
                Recognized Expert Specialist
                • Jan 2007
                • 4092

                #22
                Originally posted by happyse27
                Hi Sir,

                Yes, the upload.pl script resides in D:\Program Files\Apache Software Foundation\Apac he2.2\cgi-bin. I can show some output using http://127.0.0.1/cgi-bin/upload.pl

                However I could not find this directory htdocs/cgi-bin at all... D:\Program Files\Apache Software Foundation\Apac he2.2\htdocs is what I found which contains apache default html file index.html and I put testing.html in it which I can link using http://127.0.0.1/testing.html

                Any else I needed to set correctly?


                Thanks in advance,
                Andrew
                I'm not familair with how Apache 2.2 is setup so maybe there is no htdocs/cgi-bin folder. See Icecracks post.

                Comment

                • KevinADC
                  Recognized Expert Specialist
                  • Jan 2007
                  • 4092

                  #23
                  You can also read the manual/documentation:

                  Comment

                  • happyse27
                    New Member
                    • Sep 2008
                    • 236

                    #24
                    Hi Kelvin,

                    Thanks!

                    So many different, which one need to focus on?


                    Thanks again...
                    Andrew

                    Comment

                    • happyse27
                      New Member
                      • Sep 2008
                      • 236

                      #25
                      Hi Kelvin,

                      Thanks!

                      So many different sections, which one need to focus on?


                      Thanks again...
                      Andrew

                      Comment

                      • Icecrack
                        Recognized Expert New Member
                        • Sep 2008
                        • 174

                        #26
                        Originally posted by happyse27
                        Hi Kelvin,

                        Thanks!

                        So many different sections, which one need to focus on?


                        Thanks again...
                        Andrew
                        have you read my post above ??

                        Comment

                        • happyse27
                          New Member
                          • Sep 2008
                          • 236

                          #27
                          hi Kelvin,

                          I will try, realised that icecrack is the user in this forum. I missed out his points, will try out. Also for forum you mentioned.

                          Quote :
                          You can also read the manual/documentation:

                          http://httpd.apache.or g/docs/2.2/

                          Which section in this website url I need to focus on? As there are so many sections...


                          Thanks and Best Rgds,
                          Andrew

                          Comment

                          • KevinADC
                            Recognized Expert Specialist
                            • Jan 2007
                            • 4092

                            #28
                            If all you want to do is test your perl scripts as CGI applications you can probably skip reading the apache manual/documentation.

                            Comment

                            • KevinADC
                              Recognized Expert Specialist
                              • Jan 2007
                              • 4092

                              #29
                              My name is:

                              K-e-v-i-n

                              not:

                              K-e-l-v-i-n

                              Comment

                              • happyse27
                                New Member
                                • Sep 2008
                                • 236

                                #30
                                Hi Kevin,

                                Thanks. Sorry for the mis spelling.

                                I just want to make sure when i input some forms variables like filename and email, they got passed by the apache server to the perl script(which it is not running now). Does the apache documentation you provided help? or we dont need to go the the extent to read at the moment,

                                Thanks in advance again buddy,

                                Cheers...
                                Andrew

                                Comment

                                Working...