Re[2]: [PHP] Include???

2007-05-25 Thread Richard Davey
Hi Tedd,

Friday, May 25, 2007, 2:42:34 PM, you wrote:

 At 3:28 PM +0100 5/23/07, Richard Davey wrote:


if ($_POST['status_code'] == 'C')
   ^^

Read-up on the if/else structure and comparison operators. You'd never
use a single equals sign in this example.

 Rich:

 Read up on different font sizes that people use and you'll never use 
 ^^ to show something. :-)

Font *size* is irrelevant as long as it's monospaced ;)

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] Include???

2007-05-25 Thread tedd

At 2:46 PM +0100 5/25/07, Richard Davey wrote:

Hi Tedd,

Friday, May 25, 2007, 2:42:34 PM, you wrote:


 At 3:28 PM +0100 5/23/07, Richard Davey wrote:



if ($_POST['status_code'] == 'C')
   ^^

Read-up on the if/else structure and comparison operators. You'd never
use a single equals sign in this example.



 Rich:



 Read up on different font sizes that people use and you'll never use
 ^^ to show something. :-)


Font *size* is irrelevant as long as it's monospaced ;)

Rich


Like Henry Ford said when the model T came out You can have it in 
any color you want as long as it's black.


Cheers,

tedd

PS: Yes, I should have said font type or width and instead of size.

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] Include file questions

2007-05-25 Thread Richard Davey
Hi Tijnema,

Friday, May 25, 2007, 5:58:46 PM, you wrote:

 On 5/25/07, Robert Cummings [EMAIL PROTECTED] wrote:
 Very. Each directory contains very specific types of code/content.
 Tracking down where any given function, class, custom tag, behaviour,
 etc is defined is extremely simple.

 Cheers,
 Rob.

 I don't agree with you, i have includes in includes dir inside my
 project, images in images, etc. classes in includes dir start with
 class. configuration files in includes start with config. etc.

Oh to work on such little sized sites again :)

Not that I'm belittling your projects Tijnema, because I'm not - but
I've not worked on a site with a structure that could be that simple
for a long time now, I kinda miss it actually!! Hell even the 'images
folder' had to be split across multiple servers in the code I finished
today.

A lot of Robert's structure makes complete sense. I never keep
libraries inside the webroot that simply don't need to be there.
Infact if a script doesn't output anything 'web related' (image, rss,
html) or process data from the site, it doesn't need to live in the
webroot at all. I use a similar principal for the 'admin' area of the
site too, which I'm sure you'd hate ;) but I always code my admin
areas so that they can run on an entirely different domain name and/or
server if needs be. Only as a last resort do they ever live in /admin,
and never will they share libs that the 'public' site uses, they are
entirely stand-alone entities.

You're right in that it is down to personal preference though :)

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[2]: [PHP] Include file questions

2007-05-25 Thread Tijnema

On 5/25/07, Richard Davey [EMAIL PROTECTED] wrote:

Hi Tijnema,

Friday, May 25, 2007, 5:58:46 PM, you wrote:

 On 5/25/07, Robert Cummings [EMAIL PROTECTED] wrote:
 Very. Each directory contains very specific types of code/content.
 Tracking down where any given function, class, custom tag, behaviour,
 etc is defined is extremely simple.

 Cheers,
 Rob.

 I don't agree with you, i have includes in includes dir inside my
 project, images in images, etc. classes in includes dir start with
 class. configuration files in includes start with config. etc.

Oh to work on such little sized sites again :)

Not that I'm belittling your projects Tijnema, because I'm not - but
I've not worked on a site with a structure that could be that simple
for a long time now, I kinda miss it actually!! Hell even the 'images
folder' had to be split across multiple servers in the code I finished
today.


I have actually very big projects, with hundreds of PHP files in the
includes folder. I just give them a logical name and it works for me,
so if I have for example about 10 scripts(classes) that all relate to
file handling, I name them like this
class.file.open.php
class.file.close.php
class.file.read.php
class.file.write.php
Of course this is just an example, as you don't need a seperate class
for file opening.., but you got the point of my file naming now. With
this I don't have any problems having 100s of php files in one
directory.




A lot of Robert's structure makes complete sense. I never keep
libraries inside the webroot that simply don't need to be there.
Infact if a script doesn't output anything 'web related' (image, rss,
html) or process data from the site, it doesn't need to live in the
webroot at all. I use a similar principal for the 'admin' area of the
site too, which I'm sure you'd hate ;) but I always code my admin
areas so that they can run on an entirely different domain name and/or
server if needs be. Only as a last resort do they ever live in /admin,
and never will they share libs that the 'public' site uses, they are
entirely stand-alone entities.

You're right in that it is down to personal preference though :)

Cheers,

Rich


It doesn't need to be there, but I like to have all files for a
project in a single folder. And what does make the difference if it
doesn't output anything?

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] Include file

2005-03-30 Thread Richard Davey
Hello Jay,

Wednesday, March 30, 2005, 10:14:27 PM, you wrote:

JB I try to use both types of quotes in the proper circumstance.
JB Having said that, I came to computing in the age where we worried
JB over CPU cycles, but I don't see how in this day and age the
JB difference between the two would even matter. Even on a high load
JB site the difference between the two would be negligible.

I agree it's going to be negligible, but even so the difference does
exist. The real question is which is faster between:

include path/$file

and

include 'path/' . $file

Can the compiler handle the in-line variables quicker than string
concatenation? It'll take a C guru who knows the PHP code well to
answer this fully.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I do not fear computers. I fear the lack of them. - Isaac Asimov

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] include files, .php or .inc ?

2004-11-22 Thread Richard Davey
Hello Marek,

Monday, November 22, 2004, 12:18:22 PM, you wrote:

MK Yes, .inc files will show up as they are - php source, db
MK username/password etc. So it's even less secure unless you forbid
MK serving them:

That would be the properly configured web server section of my post,
assuming this has been done they are definitely not less secure than
placing those details in a .php.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I am not young enough to know everything. - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[2]: [PHP] include files, .php or .inc ?

2004-11-22 Thread Chris Shiflett
--- Richard Davey [EMAIL PROTECTED] wrote:
 MK Yes, .inc files will show up as they are - php source, db
 MK username/password etc. So it's even less secure unless you
 forbid serving them:
 
 That would be the properly configured web server section of
 my post, assuming this has been done they are definitely not
 less secure than placing those details in a .php.

Let's not muddy the waters, though. :-)

I have no opinion about whether .inc or .inc.php is a better convention
for modules stored within document root, because storing modules in
document root is a terrible idea. If you do this, whether by choice or due
to some factor you cannot control, you're going to have to accept that it
is a security risk, regardless of the name.

I know you both agree, but I want to make sure this point isn't lost. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming February 2005http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] include files, .php or .inc ?

2004-11-21 Thread Richard Davey
Hello Perry,

Sunday, November 21, 2004, 8:02:48 PM, you wrote:

PJ What it the purpose of the .inc file then?

Security - on a properly configured web server a .inc file will never
actually try and compile/execute itself. Whereas a .php one always
will.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 I am not young enough to know everything. - Oscar Wilde

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php