
May 21st, 2003, 07:34 PM
|
|
Junior Member
|
|
Join Date: May 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
webpage->cgi->fopen
I am using C to write a cgi that get data from a dhtml page and store them in a text file. However, the text file == NULL after I run the fopen command. I have run the sourceCode under the Unix shell and the source is oaky. (It write and safe files)
this is my source in the c program:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
FILE *outfile;
...
outfile = fopen("register.txt", "w");
if(outfile==NULL){
printf("An error has occured.\n");
return 1;
}
fprintf(outfile, "Date registered:");
fclose(outfile);
...
Anything I have done wrong? Thanks.
|