PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Nov 16, 2018 9:56 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Jul 21, 2010 10:00 pm 
Offline
Forum Newbie

Joined: Wed Jul 21, 2010 9:18 pm
Posts: 1
I'm fairly new to php. I've got a Mac with OS X 10.6.4, Apache 2.2.14, and php 5.3.1. At the moment I'm working on a number of sites where I only edit the HTML in files where the php has already been set in place, or in includes where the code is all HTML but the file extension is .php.

Is there a way to set local .php files to be displayed as .html when opened in a browser? (And have the php parts just show up as text) At the moment, trying to open them in a browser brings up the "save as" dialogue.

I know I can change the extension, but it's time-consuming to do so. I've enabled php on my computer, and am able to view php files correctly through localhost, but due to the file structure of the sites I'm working on, it's difficult and sometimes impossible to navigate to the files I want to preview through localhost, and typing in addresses to the exact files is also kind of a pain. I would love to be able to just right click on a file, select open in Firefox, and get at least some idea of what the HTML content will look like.

Does anyone know of a way to do this? I've been searching around and have found things about parsing html files as php, but not the opposite. (I apologize if this has been answered or is mis-categorized. I searched for similar posts but couldn't find an answer.)

Thanks!


Top
 Profile  
 
PostPosted: Thu Jul 22, 2010 5:22 pm 
Offline
Forum Commoner

Joined: Mon May 12, 2008 8:41 am
Posts: 82
Location: Ireland
PHP has to be processed by a PHP server. Yes, you could run a PHP script using the command line and see the resulting HTML, but that's pretty much useless if your script depends on browser data (sessions, cookies, even a simple URL). If you can't access websites made with PHP on a browser, you've got a big problem.


Top
 Profile  
 
PostPosted: Fri Jul 23, 2010 2:48 am 
Offline
DevNet Master

Joined: Wed Feb 11, 2004 4:23 pm
Posts: 4872
Location: Palm beach, Florida
I can drag .php files into a firefox window and it shows up in the browser as text.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group