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

    Writing to a file for a Guest Book

    I am a student a ITT Technical Institute and I am running into a problem writing to a file and then redirecting to another website that I created that will then read from the file and output what is in the file. I have set the permissions to the .txt file by doing both "chmod 666 book.txt" and "chcon -t httpd_sys_scrpit_rw_t book.txt". What the problem is; I can open the first page that allows me to enter the info in a text box for the name and then into a text box for the comment. when I press submit I get the internal error page and never get redirected to my other webpage. If any one can help or if you need to know wha code I have for both pages please email me at jbacon@email.itt-tech.edu.

    thank you,
    jbacon

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,871
    Thanks
    2
    Thanked 164 Times in 159 Posts
    Did you check the web server error log?

    Did you upload the script in ascii or binary mode?

    Does your shebang line have the correct path to perl?

    Is your script in the proper directory?

  • #3
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have both webpages and the .txt file in my /var/www/cgi-bin directory.
    my shebang line is /usr/bin/perl. i dont know how to do the ascii or load it in binary and i did service httpd start and its starts with no problems...plus i did my error log list for it and i would have to go back 60 error logs to get to the beginning and the first error is saying that Im missing a semi-colon on the line before my if statement but Im not(I used tail -60 /etc/httpd/logs/error_log)...i even deleted both .pl files and rewrote them...I am so stressed out about this and if I dont have it in by the end of next wekk i am screwed....if there is any other problems that u might think i could have with it plz let me know.......plus i wouldn't mind emailing my code for both pages to you if you wanna check it out.....i hate perl and cgi but the more i look into webpages i go to myself i see im gonna really need it...i see the freakin /cgi-bin/ on a lot of websites that i even use
    Last edited by jbacon; 10-31-2010 at 05:10 AM.

  • #4
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,871
    Thanks
    2
    Thanked 164 Times in 159 Posts
    The .txt file that you're wanting to write to should not be in the cgi-bin directory, neither should any .html files.

    Please post the web server error log messages that your script generates and the script itself.


  •  

    Posting Permissions

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