matthewst
(Getting the hang of it)
2006-11-15 03:29 PM
Can kix generate an html file?

I know how to get the username of the logged on user, but I need to take that information and put it in an HTML file.

HTML:
I need the script to generate this HTML file.

HTML:
Code:
      CONTENT="5; URL=C:\Documents%20and%20Settings\[b]@USERID[/b]\directory\file.html">





Is that possible?


Mart
(KiX Supporter)
2006-11-15 03:42 PM
Re: Can kix generate an html file?

You can create the HTML file with the Open() function. When the file is there you can write to it as a txt file and just write the HTML stuff and the viewable content to the file with writeline().

For example:
Code:

Break on
;
$rc = open(1, "c:\somehtmlfile.html", 5)
;
$rc = writeline (1, "stuff here" + @crlf)
$rc = writeline (1, "more stuff here" + @crlf)
$rc = writeline (1, "even more stuff here" + @crlf)
;
$rc = close(1)



matthewst
(Getting the hang of it)
2006-11-15 04:27 PM
Re: Can kix generate an html file?

you freakin rock dude!!!

LonkeroAdministrator
(KiX Master Guru)
2006-11-15 04:39 PM
Re: Can kix generate an html file?

lol

Mart
(KiX Supporter)
2006-11-15 04:59 PM
Re: Can kix generate an html file?

Quote:

you freakin rock dude!!!




LOL
Good to hear that at least one person likes me


NTDOCAdministrator
(KiX Master)
2006-11-15 07:34 PM
Re: Can kix generate an html file?

It would be better to store the data in a var and use the WRITELINE only once
when needed. Using WriteLine over and over can be a semi-expensive operation.

Something like this
Code:

$rc = "stuff here" + @crlf
$rc = $rc + "more stuff here again" + @crlf
$rc = $rc + "even more stuff here" + @crlf
$rc = writeline (1,$rc)


 


Sealeopard
(KiX Master)
2006-11-16 05:41 AM
Re: Can kix generate an html file?

However, you will have to adhere to proper HTML markups. A base structure would be
Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><title>Your title</title></head>
<body>
Your main text area
</body>
</html>



LonkeroAdministrator
(KiX Master Guru)
2006-11-16 07:29 AM
Re: Can kix generate an html file?

unless the page is loaded by:
- ie directly. it doesn't care about those tags
- http server that automatically adds the tags


NTDOCAdministrator
(KiX Master)
2006-11-16 11:07 AM
Re: Can kix generate an html file?

You get the idea matthewst ?

If you look at the MyComputerInfo script on http://www.kixhelp.com it outputs to HTML as well. You could look at it to see how I'm doing it.
Not saying that is 100% the best way, but is one way.

`