Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

single file site

0 views
Skip to first unread message

sole

unread,
May 1, 2003, 6:44:59 AM5/1/03
to
hi,
i've been looking for tutorials that show you how to make single file
websites using php and i haven't been lucky. does anyone know of any?

thanks in advance,
sole


Kevin Thorpe

unread,
May 1, 2003, 7:30:12 AM5/1/03
to

What do you mean by 'single file'?

I suspect you mean using dynamic overlays to avoid repeat round trips to
the server. php runs server side so you can't use it for such purposes.
You're stuck with javascript or flash.

andreas halter

unread,
May 1, 2003, 7:27:18 AM5/1/03
to
hi sole,

sole was scribbeling:


> i've been looking for tutorials that show you how to make single file
> websites using php and i haven't been lucky. does anyone know of any?

if i understand correctly, the easiest way is:

index.php [untested code]
<?php
if(strpos($HTTP_GET_VARS['id'],'..')!==FALSE
||strpos($HTTP_GET_VARS['id'],'/')!==FALSE)
die("error: dir traversal");

include($HTTP_GET_VARS['id'].'.php');
?>

called: http://srv.domain.tld/path/to/index.php?id=home

will cause home.php to be returned as 'index.php'.

note:
- the first line in the above script does some basic dir-traversal
checking, but cannot be seen as secure.
- your approach does work, but is not recommendet, as you'll have
to manage the files to be included anyway

hth andreas
--
collect xul annotations: http://xul.andreashalter.ch/

sole

unread,
May 1, 2003, 7:44:18 AM5/1/03
to
thanks guys

sole

"andreas halter" <ne...@andreashalter.ch> wrote in message
news:b8r0aq$ukf$1...@innferno.news.tiscali.de...

Terence

unread,
May 6, 2003, 2:41:02 AM5/6/03
to
if this is the sort of thing you want, check out "skinny". It is
designed to be a "framework-in-a-file" light-weight solution to
developing xml/xslt applications.

http://terencekearns.com/skinny

can I ask what is the reason in particular that it has to be a single file?

0 new messages