Dear Daniel: This is great info! Thanks so much for being explicit. Yes, this is how I like to do things too, modularly with a disciplined structure. The site owner is constantly wanting major changes, so it is worth the effort to clean up the code. I've wanted to bail so many times.
I'm struggling a bit with #2. I looked up _FILE_ and it says... "The full path and filename of the file. If used inside an include, the name of the included file is returned. Since PHP 4.0.2, __FILE__ always contains an absolute path with symlinks resolved"
Is this what you mean? Say I create a file called functions.php that is in the /php directory. Then in my /php/reserve.php file in the <head> section it will say<?php include('functions.php'); ?>and the first lines of the functions.php file will be:
Sorry if I am a moron here, but the slash doesn't make sense to me. I would have thought it would be a hyphen. When parsed, does _FILE_ turn into functions.php? Wouldn't it be easier to just write functions.php? This is how I imagine it...Code:include (_FILE_).'/email.php'; include (_FILE_).'/arrays.php'; include (_FILE_).'/users.php';
Sorry if this went right over my head.Code:include('functions-email.php'); include('functions-arrays.php'); include('functions-users.php');
6. I've never written a function before but am game to try.
Many thanks, e![]()



Reply With Quote

Bookmarks