Submit Your Article Forum Rules

Results 1 to 4 of 4

Thread: Text File On Webserver HD using CGI and C/PERL

  1. #1
    Junior Member
    Join Date
    Aug 2004
    Posts
    4

    Text File On Webserver HD using CGI and C/PERL

    Hello Everyone,

    Im looking for a bit of help. I am new to the game of setting up webservers. However I have managed to install an Apache webserver on Windows XP.

    I have a number of question which I hope someone out there may know:

    (1) What is the best way to go about setting up a CGI-bin on an Apache webserver on XP.

    (2) What I want to do is to ask a user to click Button1 or Button2 on my HTML website homepage. If the user presses button1 I want to call a program in my CGI-bin to write the letter A to a text file on my server PC desktop. If the user presses the other button (button2) I want to call a program in my CGI-bin to write "B" to the same text file(overwrite it if possible). Whatever the user presses must be sent/saved to a text file on the hard drive of the server PC. What is the best way of doing this?

    (3) I really want to use a C program(as opposed to PERL) in Cgi-bin to send "A "to a text file whenever button1 is pressed and "B" to the same text file whenever button2 is pressed.

    (a) Is it possible to run a C program from the Cgi-bin and execute it from the internet(I am using my own server).

    (b) Does the server or Cgi-bin have to be configured in a special way to execute C programs?

    (c) If it is possible then how should I best compile the C/C++ to suit this application? How do I transfer my C files from my folder on desktop to the Cgi-bin when I am ready to do so?

    (d) Do I need to install special privilages to create a text file on the server HD from the internet? How is this done?

    Any hepl or advice appreciated. Not many people seem to know much about CGI applications using C. Like I said before all I want to do is ask the user to click one of two buttons on my website and then write A to a text file on my server PC desktop if he/she presses tthe 1st button or write B to a text file on my server PC desktop if she/he presses the 2nd button. There is only one single text file but I could use 2 different CGI programs for each button. Thanks for taking time to read this and I hope someone can help!!

    Dermot

  2. #2
    Junior Member
    Join Date
    Aug 2004
    Posts
    4

    CGI Text file on hd using c/c++/perl

    Also is this possible to do using PHP? Has anyone ever tried this before using any language or method?

  3. #3
    Senior Member redcircle's Avatar
    Join Date
    Aug 2003
    Posts
    424
    www.php.net very easy to do.
    www.squitosoft.com - PHP development site. featuring Squito Gallery. a php driven photo gallery.
    www.rgfx.net - Specializing in Internet solutions, including Html authoring, Interactive Web sites, 3D/2D Graphics and animation.

  4. #4
    Junior Member
    Join Date
    Aug 2004
    Posts
    4

    Thanks

    Thanks, very good/helpfull links.

    Also what would be even better for me is if I could execute a program(C program) to control the serial port from the internet. I have a serial control C program written and working. Can I have a button on my webpage to execute this program when pressed?

    Can I throw this program straight into my CGI-bin or should I use PHP also for this? I am totally new to PHP.

    I will let u know how I get on.

    Thanks, Dermot.

Similar Threads

  1. PERL pass "Perl" crash
    By TrafficProducer in forum Web Programming Discussion Forum
    Replies: 0
    Last Post: 09-02-2007, 02:07 PM
  2. Retrieving Text From File, No Dynamic Languages
    By Evic in forum Web Programming Discussion Forum
    Replies: 5
    Last Post: 08-19-2005, 02:52 PM
  3. Reading PDF text in Perl
    By brian.mark in forum Web Programming Discussion Forum
    Replies: 4
    Last Post: 10-19-2004, 07:06 PM
  4. Edit text via a text file or word doc?
    By randelld in forum Graphics & Design Discussion Forum
    Replies: 2
    Last Post: 08-08-2004, 05:07 AM
  5. Writing to a text file from a form
    By MrLeN in forum Web Programming Discussion Forum
    Replies: 2
    Last Post: 05-19-2004, 12:40 AM

Posting Permissions

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