php in separate file

General discussions related to php

Moderators: macek, egami, gesf

tranquillo
New php-forum User
New php-forum User
Posts: 74
Joined: Sun Nov 24, 2002 6:48 pm
Location: katrineholm
Contact:

php in separate file

Postby tranquillo » Fri Jun 06, 2003 12:18 pm

Hi..
I've heard that in asp.net you can do the graphics in a html document and have the asp.net code in a separate file.
is this possible in php4?
if so, how do you connect them?

bonkers
New php-forum User
New php-forum User
Posts: 46
Joined: Wed Mar 12, 2003 7:17 pm

Postby bonkers » Fri Jun 06, 2003 4:25 pm

If what you're asking is if you could like...I dunno, Make a complete page in HTML, and just add little parts where you want PHP code? I mean sure! All you have to do is in your PHP code in your new file is

Code: Select all

include '../relative/path/of/whatever.html';


and it'll be included. Personally I like to have one template file, and I put variables where there is dynamic content. Then In another file, say like index.php I define $body and $header and $title, and then I include the php template file, and it puts those in... boom..

http://us2.php.net/include

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: php in separate file

Postby WiZARD » Sun Jun 08, 2003 12:31 am

tranquillo wrote:Hi..
I've heard that in asp.net you can do the graphics in a html document and have the asp.net code in a separate file.
is this possible in php4?
if so, how do you connect them?

Yes you may do it cause PHP support GD library and more...

User avatar
Joan Garnet
Moderator
Moderator
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars
Contact:

Postby Joan Garnet » Wed Jun 11, 2003 8:40 am

For example using inline frames <iframe>
Or with the other possible options above.


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 2 guests