spikypunker Posted October 17, 2009 Share Posted October 17, 2009 Currently testing a site thats almost built, am going to be including php on a sidebar on all pages so thought it'd be easier to just make all pages .php, however when i upload and try and view, in Firefox it just displays the source code on screen! It does it on other computers, but works fine in IE! ARRGGGHH Anyone have a clue? Kind Regards, Chris Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/ Share on other sites More sharing options...
waynew Posted October 17, 2009 Share Posted October 17, 2009 I would doubt that this is an issue with Firefox. It is most likely either a problem with your server (does it support PHP?) or your code itself. Post your code. Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938653 Share on other sites More sharing options...
mrMarcus Posted October 17, 2009 Share Posted October 17, 2009 you might be missing an opening <?PHP tag. Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938654 Share on other sites More sharing options...
Dorky Posted October 17, 2009 Share Posted October 17, 2009 you might be missing an opening <?PHP tag. i second the motion lol. put <?php before anything and ?> after evrything. at least in regards to the php portion. Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938656 Share on other sites More sharing options...
spikypunker Posted October 17, 2009 Author Share Posted October 17, 2009 Well thats the thing, there's not any php on the page yet! I've done this before, save the page as a .php page because i know that i'll be inserting php elements later in the build and never had a problem before! It works fine in IE, but not firefox! grr http://www.thebookhive.co.uk Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938657 Share on other sites More sharing options...
Dorky Posted October 17, 2009 Share Posted October 17, 2009 wow, that was interesting. i got code too. weird man just weird. are you sure your host supports php? idk man. Well thats the thing, there's not any php on the page yet! I've done this before, save the page as a .php page because i know that i'll be inserting php elements later in the build and never had a problem before! It works fine in IE, but not firefox! grr http://www.thebookhive.co.uk Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938660 Share on other sites More sharing options...
spikypunker Posted October 17, 2009 Author Share Posted October 17, 2009 Well it's hosted with 123reg so must support it, but it could be disabled? Thier phoneline is closed today so will have to speak to them on monday. But it still kinda doesnt make sense seeing that it works in IE? YA KNOW WHAT, i'm starting to like the new IE over Firefox dammit.... Anyone else have any ideas? Thanks for your help so far dudes, peace Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938665 Share on other sites More sharing options...
Dorky Posted October 17, 2009 Share Posted October 17, 2009 yes i do have another idea. ie is evil and we don't want to lose you to the dark side. Well it's hosted with 123reg so must support it, but it could be disabled? Thier phoneline is closed today so will have to speak to them on monday. But it still kinda doesnt make sense seeing that it works in IE? YA KNOW WHAT, i'm starting to like the new IE over Firefox dammit.... Anyone else have any ideas? Thanks for your help so far dudes, peace Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938669 Share on other sites More sharing options...
spikypunker Posted October 17, 2009 Author Share Posted October 17, 2009 Well there's no real chance of that, just tried it in Chrome and i'm getting code, so IE is the odd one out! Man it's annoying.... Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938671 Share on other sites More sharing options...
michaelk46 Posted October 17, 2009 Share Posted October 17, 2009 I had a similar problem and it turned out to be a issue with where dreamweaver thought the file was regardless of where it actually was. I ended Up having to move the files into a seperate folder inside Dreamweaver and letting it update the pointers and then I moved back updating the pointers again, then it worked fine. Hope this helps... Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938672 Share on other sites More sharing options...
spikypunker Posted October 17, 2009 Author Share Posted October 17, 2009 lol....pointers? Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938680 Share on other sites More sharing options...
PFMaBiSmAd Posted October 17, 2009 Share Posted October 17, 2009 Your web server and/or something you have done in the control panel or a .htaccess file is causing the mime content type to be output as text/plain Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938684 Share on other sites More sharing options...
yettti Posted October 17, 2009 Share Posted October 17, 2009 looks like whatever http server is serving the files is sending out an incorrect content type header for the file : :-\ EDIT: Defiantly correct, IE doesn't pay as much attention to the header types Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938685 Share on other sites More sharing options...
MadTechie Posted October 17, 2009 Share Posted October 17, 2009 http://www.thebookhive.co.uk Content-Type: text/plain should be Content-Type: text/html you have a header issue or your server is set-up incorrectly, dumb IE is displaying it at HTML which is wrong Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938686 Share on other sites More sharing options...
spikypunker Posted October 17, 2009 Author Share Posted October 17, 2009 Riiiiight ok, so the server has PHP disabled and Firefox and the others display as text, but IE tries to display it as HTML right. So i'm gonna have to contact hosters on monday? I've only just started this project and havent talked to them yet, the client arranged all that side of things this time. Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938687 Share on other sites More sharing options...
Dorky Posted October 17, 2009 Share Posted October 17, 2009 Riiiiight ok, so the server has PHP disabled and Firefox and the others display as text, but IE tries to display it as HTML right. So i'm gonna have to contact hosters on monday? I've only just started this project and havent talked to them yet, the client arranged all that side of things this time. ah indeed. i wont do an account on another host. either i host it or sell the files. wont fool around with setting up on another host or any of that jaz. because when it fouls up down the road they want you to come in and play tech support for free. i feel for ya. Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938697 Share on other sites More sharing options...
spikypunker Posted October 17, 2009 Author Share Posted October 17, 2009 Yeah but i have to set up some MySql stuff and they wouldnt have a clue! lol, na but it's all good, am trying to make my way in the freelance world so therefore will be as helpfull as possible and do as much as i can...then charge for it haha. Lol, but yeah, i do have my own unlimited space and when i'm getting work through the new design website i will be telling my clients I prefer to host for them, but this one was a guy setting up a company and already had the domain and space. But anyway thanks for the help, looks like its just the hosters disabling PHP! Probably a feature that wasnt included in the base package, anyway at least it's not my fault! Cheers dudes! Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938703 Share on other sites More sharing options...
Kaboom Posted October 17, 2009 Share Posted October 17, 2009 just add this at top? <?php here ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTNL 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> Try that edit: take the php stuff off or add code there and yes if you missed that it IS your fault Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938760 Share on other sites More sharing options...
GoneNowBye Posted October 17, 2009 Share Posted October 17, 2009 I have not read any of the above. By default <? is not allowed as an opening tag it must be <?php, this is set as php_short_tags=on/off in php.ini. PHP is never displayed if it is processed as its processed and the result sent to the client. Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938761 Share on other sites More sharing options...
mrMarcus Posted October 17, 2009 Share Posted October 17, 2009 Riiiiight ok, so the server has PHP disabled and Firefox and the others display as text, but IE tries to display it as HTML right. So i'm gonna have to contact hosters on monday? I've only just started this project and havent talked to them yet, the client arranged all that side of things this time. you host is only a monday to friday gig? man, change that in a hurry before things really get rolling. you need that customer support 24/7. i concur with the other comments .. check .htaccess and such. Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938845 Share on other sites More sharing options...
Kaboom Posted October 18, 2009 Share Posted October 18, 2009 -.- ..... just add the XHTML tag in the html header so the server reads it as an html doc not text ... seriously Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-938945 Share on other sites More sharing options...
spikypunker Posted October 20, 2009 Author Share Posted October 20, 2009 Na id taken all tags out just to see why it wasnt working. The client chose their own package before they contacted me for design and build. They're with 123-reg, and yes it's only mon-fri phone support. I phoned them up and basically PHP isnt included in their basic package, so i had to advise my client they need to upgrade for an extra £2.50 a month! Cheeky Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-940309 Share on other sites More sharing options...
romegas Posted August 9, 2010 Share Posted August 9, 2010 hi spikypunker, in the httpd.conf file, look for the "IfModule mime_module section" and at the end of this section add the following line : AddType application/x-httpd-php .php Worked for me so hope this help you. Here is the section for my conf : <IfModule mime_module> # # TypesConfig points to the file containing the list of mappings from # filename extension to MIME-type. # TypesConfig conf/mime.types # # AddType allows you to add to or override the MIME configuration # file specified in TypesConfig for specific file types. # #AddType application/x-gzip .tgz # # AddEncoding allows you to have certain browsers uncompress # information on the fly. Note: Not all browsers support this. # #AddEncoding x-compress .Z #AddEncoding x-gzip .gz .tgz # # If the AddEncoding directives above are commented-out, then you # probably should define those extensions to indicate media types: # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz # # AddHandler allows you to map certain file extensions to "handlers": # actions unrelated to filetype. These can be either built into the server # or added with the Action directive (see below) # # To use CGI scripts outside of ScriptAliased directories: # (You will also need to add "ExecCGI" to the "Options" directive.) # #AddHandler cgi-script .cgi # For type maps (negotiated resources): #AddHandler type-map var # # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # #AddType text/html .shtml AddType application/x-httpd-php .php #AddOutputFilter INCLUDES .shtml </IfModule> Quote Link to comment https://forums.phpfreaks.com/topic/178026-firefox-displaying-php-source-code/#findComment-1096926 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.