Jump to content

Recommended Posts

Hi,

 

I'm a designer, currently building pages in HTML with .php extensions, because the pages will ultimately be programmed with php.  Well, on my home office computer, I can open the pages with .php extensions with either Firefox or IE -- no problem.  Just right-click the files, and "Open With", and they display perfectly.

 

But now I'm working on the pages on my work office computer, and can't open them with either browser.  When I try to open the pages to view in the browsers, both browsers ask me to either 'open' or 'save.'  But neither will actually open the pages.  What's strange is, I believe I have the same browser versions on both my home and work machines. 

 

I need to view my .php pages in both browsers while I'm laying them out.  Does anyone know what the problem could be?

 

Thanks so much

Link to comment
https://forums.phpfreaks.com/topic/102190-browser-anomoly/
Share on other sites

Hi,

 

I'm a designer, currently building pages in HTML with .php extensions, because the pages will ultimately be programmed with php.  Well, on my home office computer, I can open the pages with .php extensions with either Firefox or IE -- no problem.  Just right-click the files, and "Open With", and they display perfectly.

 

But now I'm working on the pages on my work office computer, and can't open them with either browser.  When I try to open the pages to view in the browsers, both browsers ask me to either 'open' or 'save.'  But neither will actually open the pages.  What's strange is, I believe I have the same browser versions on both my home and work machines. 

 

I need to view my .php pages in both browsers while I'm laying them out.  Does anyone know what the problem could be?

 

Thanks so much

 

You can't open .php files in your browser with Open.  You need to run them on a web server (like Apache), which has the PHP parser installed, and it can display the PHP files.  The .php extension should ONLY be used if you have a running web server.

Link to comment
https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523071
Share on other sites

i get the same problem, I am browsing round the internet, then (usually on a forum) my computer seems to forget that php files are a website so asks so I want to download the php file of open it. either 1 i view just downloads it and then open just asks me what I want to view it with.

 

any ideas as it can get very annoying if I am trying to post on a forum and I click the submit button and it comes up with a dialog box for submit.php or whatever the files is called.

Link to comment
https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523083
Share on other sites

Ok, everyone's telling me it's not possible to view .php pages in a browser unless they're running on a server.  But that's the strange part -- I'm telling you, I can view them on my browsers on my home computer [which is not running any server], but not at work.  And I don't know what could be different about the machines.

 

I will look into the Apache servers.  Do designer/developers who build .php sites always have a server installed on their local machine in order to view their pages?

 

Thanks again

Link to comment
https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523087
Share on other sites

Well, metrov, that's very strange.  It's probably because there's no PHP in it, partly.  If there was PHP in it, the PHP would just display the source code right onto the browser window.  And yes, every developer has a local Apache server or a hosted server that they use.  I host my own server, personally. =)

Link to comment
https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523089
Share on other sites

In order for PHP scripts to execute, you need the PHP parsing engine/library configured correctly to run with a webserver such as Apache or Lighttpd. It isn't possible for a browser (Firefox in your case) to execute a Server Side (PHP) script.

 

Only web servers can recognise server side MIME types, unless you're executing the script locally in which case a server isn't required. (PHP isn't just for web development).

Link to comment
https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523091
Share on other sites

I believe that's the answer -- there's no code in the pages yet on my home computer.  But the pages on my work computer must have some code in them that's preventing them from being opened by the browsers.

 

I think the best and easiest solution for me at this point is to just leave the .html extensions for now, then change them when ready to turn over the my programmer.

 

Thanks for all the help!

Link to comment
https://forums.phpfreaks.com/topic/102190-browser-anomoly/#findComment-523095
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.