[thelist] .htaccess / PHP file creation / blog database design

Burhan Khalid burhankhalid at members.evolt.org
Tue Feb 26 17:55:01 CST 2002


Lets take a crack at this :

>Does anyone have some good links to articles on .htaccess?
>Also, my quicker question is, in my meo account, how do I
>redirect from the main directory to one called 'thoughts'?

There are ways you can do this within any scripting language that sends
headers (which doesn't)?
You can also use a meta tag :
<meta http-equiv="Refresh" Content="3;URL=http://www.some.org/some.html">
                                                        ^ (timer in seconds)
Or you can use events, ie. body.onload, etc. etc. etc.
Here is a Meta tag reference :http://vancouver-webpages.com/META/


>Secondly, does anyone know how to create files with PHP? (I
>glanced through the function list for files, and none
>seemed apparent, however I'm not feeling too well, and I
>might have missed something.)

In PHP, here is a code snippet :

$filePointer = fopen("somefile.dat", "w");

According to the PHP documentation :

'w' - Open for writing only; place the file pointer at the beginning of the
file and truncate the file to zero length. If the file does not exist,
attempt to create it.

More on this at : http://www.php.net/manual/en/function.fopen.php


>Lastly, I was trying to think of a database structure for
>my own blog, and the only two fields I came up with were
>datetime, as the key, and a text for the entry. This seems
>a bit too simple to me... can anyone think of anything
>which I will regret not having added at some point in the
>future?

I would also add a topic/category field, an author field (in case you want
others to contribute to your blog). For now, that's all I can think of. You
really can create a blog with a simple flat file (maybe its the
hammer-as-a-fly-swatter situation?)

Regards,
Burhan Khalid




More information about the thelist mailing list