Page 1 of 1 1
Topic Options
#170306 - 2006-11-15 03:29 PM Can kix generate an html file?
matthewst Offline
Getting the hang of it

Registered: 2005-01-26
Posts: 89
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?

Top
#170307 - 2006-11-15 03:42 PM Re: Can kix generate an html file?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4636
Loc: The Netherlands
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)

_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#170308 - 2006-11-15 04:27 PM Re: Can kix generate an html file?
matthewst Offline
Getting the hang of it

Registered: 2005-01-26
Posts: 89
you freakin rock dude!!!
Top
#170309 - 2006-11-15 04:39 PM Re: Can kix generate an html file?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22302
Loc: OK
lol
Top
#170310 - 2006-11-15 04:59 PM Re: Can kix generate an html file?
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4636
Loc: The Netherlands
Quote:

you freakin rock dude!!!




LOL
Good to hear that at least one person likes me
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#170311 - 2006-11-15 07:34 PM Re: Can kix generate an html file?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11558
Loc: CA
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)


 

Top
#170312 - 2006-11-16 05:41 AM Re: Can kix generate an html file?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
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>

_________________________
There are two types of vessels, submarines and targets.

Top
#170313 - 2006-11-16 07:29 AM Re: Can kix generate an html file?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22302
Loc: OK
unless the page is loaded by:
- ie directly. it doesn't care about those tags
- http server that automatically adds the tags

Top
#170314 - 2006-11-16 11:07 AM Re: Can kix generate an html file?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11558
Loc: CA
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.

`

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 138 anonymous users online.
Newest Members
Steff, phanhuyen, Jeroen_Ruijter, Tienn, tmvngocdung42
17545 Registered Users

Generated in 0.054 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org