MozillaZine

viewing php includes from local files

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Lookinglasss

User avatar
 
Posts: 100
Joined: April 12th, 2008, 9:17 am
November 6th, 2009, 5:48 am

Post Posted November 6th, 2009, 5:48 am

Hi

I'm using php includes to avoid code duplication. Although FF displays the local php files fine it doesn't include the < php include > files. I managed to get IE to do it by accident once but usually if I put the address in the location bar, hit RTN *pouf* I'm back in FF with the page open in a new tab!... and the same problem. ](*,)

How can I set FF to display the < includes > as well as the host page? :?: At the moment all I can do to check things are working is upload the files to the site and edit them via FTP on a subdirectory :crazyeyes:

I'm using FF 3.5.4 and WinXPpro SP2

Thanks folks

robin

peter.reisio

User avatar
 
Posts: 3029
Joined: March 3rd, 2004, 6:57 pm
November 6th, 2009, 10:35 am

Post Posted November 6th, 2009, 10:35 am

This is not up to Firefox or IE, only your web server & code. You want to use <?php include("foo"); ?> in a file with the extension .php

If you'd like to be able to test things locally, consider installing Apache with PHP: http://www.apachefriends.org/en/xampp-windows.html

Lookinglasss

User avatar
 
Posts: 100
Joined: April 12th, 2008, 9:17 am
November 6th, 2009, 12:52 pm

Post Posted November 6th, 2009, 12:52 pm

hmm ... it's not to do with my web server as I am testing (viewing) the files that are stored locally (on my laptop). I can view HTML files for instance (together with their javascrpt etc, and I can view the PHP files too. What I can't do is to see the complete PHP page including the < included > PHP code ... I haven't a clue what the fifference is between PHP and HTML. I just change the extensions and bingo all is fine. I use the < require > command for the includes.

trolly
Moderator

User avatar
 
Posts: 33197
Joined: August 22nd, 2005, 7:25 am
November 6th, 2009, 1:20 pm

Post Posted November 6th, 2009, 1:20 pm

PHP is a server side script language, while JS is a client side language. And HTML is the layout/design language.
Saying it differently PHP is executed in the server, while JS and HTML is executed in the browser.
Think for yourself.
Otherwise you have to believe what other people tell you.

Lookinglasss

User avatar
 
Posts: 100
Joined: April 12th, 2008, 9:17 am
November 6th, 2009, 1:23 pm

Post Posted November 6th, 2009, 1:23 pm

Thanks Trolly, so it's impossible without the installing Apache locally and the rest. Oh well.

Have a great weekend :)

BenoitRen

User avatar
 
Posts: 5725
Joined: April 11th, 2004, 10:20 am
Location: Belgium
November 7th, 2009, 9:36 am

Post Posted November 7th, 2009, 9:36 am

trolly wrote:And HTML is the layout/design language.

Eek! HTML describes the document's structure and semantic content. Style and lay-out should be left to CSS!

trolly
Moderator

User avatar
 
Posts: 33197
Joined: August 22nd, 2005, 7:25 am
November 7th, 2009, 10:22 am

Post Posted November 7th, 2009, 10:22 am

No details please. Just the basic facts.
Think for yourself.
Otherwise you have to believe what other people tell you.

BenoitRen

User avatar
 
Posts: 5725
Joined: April 11th, 2004, 10:20 am
Location: Belgium
November 9th, 2009, 11:15 am

Post Posted November 9th, 2009, 11:15 am

The problem was that some of your basic facts were wrong. I corrected them. That is all.

trolly
Moderator

User avatar
 
Posts: 33197
Joined: August 22nd, 2005, 7:25 am
November 9th, 2009, 11:59 am

Post Posted November 9th, 2009, 11:59 am

Sure but he did not mention CSS at all.
Separate content and layout -> content -> (X)HTML, layout -> CSS

But i guess it is not really important to a PHP problem.
Think for yourself.
Otherwise you have to believe what other people tell you.

BenoitRen

User avatar
 
Posts: 5725
Joined: April 11th, 2004, 10:20 am
Location: Belgium
November 10th, 2009, 7:03 am

Post Posted November 10th, 2009, 7:03 am

No, he didn't mention CSS. You did indirectly when you said "design/layout". It's only natural that I would mention CSS in that case.

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 5 guests