Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

include in php
Which is the corresponding in php of asp command:
<!-- #Include file="file.asp" -->
?



Report this thread to moderator Post Follow-up to this message
Old Post
Shearer
07-15-06 11:56 PM


Re: include in php
Shearer wrote:

> Which is the corresponding in php of asp command:
> <!-- #Include file="file.asp" -->
> ?

<?php include "file.txt" ?>

--
Els                     http://locusmeus.com/

Now playing: Yes - The Remembering (High the Memory)

Report this thread to moderator Post Follow-up to this message
Old Post
Els
07-15-06 11:56 PM


Re: include in php
<?php include "file.txt"; ?>

Do not forget the semicolon.

-Lost



Report this thread to moderator Post Follow-up to this message
Old Post
-Lost
07-16-06 11:56 PM


Re: include in php
Den 16.07.2006 16:09, skriblet -Lost følgende:
> <?php include "file.txt"; ?>
>
> Do not forget the semicolon.

I just use <?php include 'file.inc' ?> - is this wrong?

--
mvh
Ørjan Langbakk
http://www.bergenpchjelp.no
http://www.cubic-design.net

Report this thread to moderator Post Follow-up to this message
Old Post
Ørjan Langbakk
07-16-06 11:56 PM


Re: include in php
Ørjan Langbakk wrote:
> Den 16.07.2006 16:09, skriblet -Lost følgende: 
>
> I just use <?php include 'file.inc' ?> - is this wrong?


Not wrong, but bad practise.

Grtz,
--
Rik Wasmus



Report this thread to moderator Post Follow-up to this message
Old Post
Rik
07-16-06 11:56 PM


Re: include in php
Den 16.07.2006 16:27, skriblet Rik følgende:
> Ørjan Langbakk wrote: 
>
>
> Not wrong, but bad practise.

Why is it bad practise? I'm relatively new to PHP, and yes, I am a bit
 as to when I should use " and ', but in this particular case,
why is the include using '' bad?

--
mvh
Ørjan Langbakk
http://www.bergenpchjelp.no
http://www.cubic-design.net

Report this thread to moderator Post Follow-up to this message
Old Post
Ørjan Langbakk
07-16-06 11:56 PM


Re: include in php
"Rik" <luiheidsgoeroe@hotmail.com> wrote in message
 news:37234$44ba4c81$8259c69c$13966@news1
.tudelft.nl...

> Not wrong, but bad practise.
>
> Grtz,
> --
> Rik Wasmus

What Rik said.

If you tend to code *neatly* as it were, you can be assured that it is not t
he culprit
when a problem does arise.

-Lost



Report this thread to moderator Post Follow-up to this message
Old Post
-Lost
07-16-06 11:56 PM


Re: include in php
Ørjan Langbakk wrote:
> Den 16.07.2006 16:27, skriblet Rik følgende: 
>
> Why is it bad practise? I'm relatively new to PHP, and yes, I am a bit
>  as to when I should use " and ', but in this particular case,
> why is the include using '' bad?


Euhm, I was referring to the semicolon.

both are Bad Practise without semi-colon:
<?php include "file.txt" ?>
<?php include 'file.txt' ?>

Unnecessary extra evaluation in PHP:
<?php include "file.txt"; ?>

Good Practise:
<?php include 'file.txt'; ?>

Unless offcourse you want to use variable name to name your include file,
else '' is better then "".

Grtz,
--
Rik Wasmus



Report this thread to moderator Post Follow-up to this message
Old Post
Rik
07-16-06 11:56 PM


Re: include in php
"Shearer" <shearer@libero.it> wrote in message
news:Od7ug.41579$_J1.500251@twister2.libero.it...
> Which is the corresponding in php of asp command:
> <!-- #Include file="file.asp" -->
> ?
>

I use

<?php require_once("file.xxx" ); ?>

Shelly



Report this thread to moderator Post Follow-up to this message
Old Post
Sheldon Glickler
07-16-06 11:56 PM


Re: include in php
Den 16.07.2006 16:52, skriblet Rik følgende:
> Ørjan Langbakk wrote: 
>
>
> Euhm, I was referring to the semicolon.
>
> both are Bad Practise without semi-colon:
> <?php include "file.txt" ?>
> <?php include 'file.txt' ?>
>
> Unnecessary extra evaluation in PHP:
> <?php include "file.txt"; ?>
>
> Good Practise:
> <?php include 'file.txt'; ?>
>
> Unless offcourse you want to use variable name to name your include file,
> else '' is better then "".
>
> Grtz,

Ah. Then I'm following you -  I thought you meant the whole ''-thing,
not only the semicolon - I'll start using that then :)

--
mvh
Ørjan Langbakk
http://www.bergenpchjelp.no
http://www.cubic-design.net

Report this thread to moderator Post Follow-up to this message
Old Post
Ørjan Langbakk
07-17-06 02:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:19 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.