|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
Simple Question:
Has the user who is running the webserver write access to the directory where your cgi-skript is running? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > webpage->cgi->fopen |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|