i want to write the output and logs in to a output.html file how can i do this
we have got a xml writer u know and i want a html writer too please help me
help with html file writing
-
- Posts: 12
- Joined: Fri Sep 24, 2004 5:26 pm
help with html file writing
..:::radiation interactive:::..
Exactly what do you mean by " output"?
It's quite simple to just dump a header, some lines and a footer into a text file, you know.
If all you're doing is writing text lines to a .html file, all you need to do is write tags and text.
No need for anything complicated, just something along the lines of:
FILE *logfile;
logfile=fopen(logfilename,"w");
fprintf(logfile,"<html>\n<title>log file</title>\n<body>\n");
// when you have some message text to print:
fprintf(logfile,"<p>%s</p>\n",messagetext);
fprintf(logfile,"</body></html>\n");
fclose(logfile);
It's quite simple to just dump a header, some lines and a footer into a text file, you know.
If all you're doing is writing text lines to a .html file, all you need to do is write tags and text.
No need for anything complicated, just something along the lines of:
FILE *logfile;
logfile=fopen(logfilename,"w");
fprintf(logfile,"<html>\n<title>log file</title>\n<body>\n");
// when you have some message text to print:
fprintf(logfile,"<p>%s</p>\n",messagetext);
fprintf(logfile,"</body></html>\n");
fclose(logfile);