[geeks] using script to generate files from a template

William S. wstan at xs4all.nl
Sun Jun 16 11:36:43 CDT 2002


Dave,

Thank you for that idea. When your reply came in
I was reading the awk manual in anticipation of
generating all the files. Instead, I should probably
be reading the php, XSL stuff for ways of setting
variables, etc. In regards to security. It might be
nice to submit the site to the geeks list members
to see if you guys can "break" it before posting
it to the outside world. That way I will have
some confidence that I didn't blunder in some
subtle way.  :)

On Sun, Jun 16, 2002 at 10:19:52AM -0600, Dave Kimmel wrote:
<snip>
> 
> It might be better to just pass the name of the city as a GET parameter.
> Then at the start of your code, put something like:
> 
> $xml = $HTTP_GET_VARS['city'] . '.xml';
> $xsl = $HTTP_GET_VARS['city'] . '.xsl';
> 
> This way, if I understand what you're doing, you'll eliminate the need for
> 50+ nearly identical .php files.
> 
> Of course, you will want code to prevent someone from reading any random
> file off of your machine.  Perhaps another XML document listing all of the
> cities and their corresponding .xml and .xsl files?  That way if they
> provide a "city" of "/etc/passwd" or something it won't find it and will
> return an error.
> 

-- 
Bill
Amsterdam, NL



More information about the geeks mailing list