Question:
why do web sites have PHP as their file extensions instead of HTML extensions?
Priya
2009-09-17 06:55:27 UTC
I have imported one existing website into Frontpage2003 (on my pc)
but the files of this site shows .PHP file extensions. I want to edit these web pages (files). can i edit these files ?? If no then how can i do that ?
Seven answers:
Psychic Computer RepairĀ® PEBKAC?
2009-09-17 07:06:23 UTC
PHP cannot be edited by Frontpage. You need a PHP editor which is different.

~

List of free PHP editors

http://search.yahoo.com/search?fr=yfp-t-875-s&toggle=1&cop=mss&ei=UTF8&rd=r2&p=free%20php%20editor
oracle128au
2009-09-17 14:51:00 UTC
PHP is what's called a server-side scripting language.

What this means is that the website developer has written his site in the programming language PHP, so he can take advantage of programming constructs to generate dynamic page content, do calculations, interact with databases etc. Then when you request a page from his site, the web server has processed the PHP script and sent you the output from it (usually a HTML page).



Because it's been processed before it's sent to you, what you have is the HTML (and possibly CSS and JavaScript) output from the PHP script, not the PHP code itself, which is impossible for you to obtain without asking the site developer to email it to you.



Which is good from the site developer's perspective, because PHP files often reveal information about the web server, its folder structure, contain database passwords etc which would be useful to potential hackers.



If you don't care about the dynamic nature behind the pages and only need the output, then that's not a problem, you can edit the files in Frontpage or Dreamweaver if you want. You could even use a real website development tool. This all assumes, of course, that you don't mind the moral and legal ramifications of stealing somebody else's work.



On the other hand, if I've made incorrect accusations, and you actually do have the original PHP source files because you are taking over development of the website for somebody else, then I apologise.

The correct accusation to make in this case would be that you have no business trying to develop a website when you clearly have no idea what you're doing (Frontpage says it all really), and that you've grossly misrepresented your abilities to some poor sap.
anonymous
2009-09-17 14:49:55 UTC
The php extension indicates to the server that the page contains code written in the PHP programming language. You should be able to import the page to Frontpage (it is a text file just like HTML pages) but Frontpage's visual editor will not be able to interpret the added code. If you look in code view, you'll probably see new elements that are unfamiliar.



HTML isn't really a programming language, and it can't do certain things like send emails or talk to databases. For this reason, many pages are now written using PHP or other server-side language. These languages do more advanced work, and then they create HTML as their output.



Normally you'll see the page written primarily as HTML, but a special code indicates a switch to PHP programming:



Counting to five






    for ($i = 1; $i <= 5; $i++){

    print "
  • $i
  • \n";

    } // end for

    ?>





The code in between is written in PHP, and produces an HTML list as its output.



You can edit a PHP file with any text editor (including FrontPage in code view) but it's probably best to get a dedicated programmer's editor to assist with syntax highlighting and integrated help features. I like notepad++ on Windows, emacs on Linux or Mac, and Aptana (a visual GUI) on any platform.



You can still edit the HTML part of the page without problems, but if you don't know what you're doing, you should probably leave the PHP part alone.



I have plenty of examples available for free on my web site if you want more information.
anonymous
2009-09-17 16:23:01 UTC
Hello,



The difference is that PHP, or PHP: Hypertext Preprocessor, is a widely used, general-purpose scripting language that was originally designed for web development, to produce dynamic web pages. It can be embedded into HTML and generally runs on a web server, which needs to be configured to process PHP code and create web page content from it. It can be deployed on most web servers and on almost every operating system and platform free of charge. PHP is installed on over 20 million websites and 1 million web servers.



HTML is how the data is shown and is more of a organizational tool in web design.



Good Luck!

Sean Colicchio

Server Engineer

hosting.com
anonymous
2009-09-17 13:59:14 UTC
PHP, or PHP: Hypertext Preprocessor, is a widely used, general-purpose scripting language that was originally designed for web development, to produce dynamic web pages. It can be embedded into HTML and generally runs on a web server, which needs to be configured to process PHP code and create web page content from it. It can be deployed on most web servers and on almost every operating system and platform free of charge.[2] PHP is installed on over 20 million websites and 1 million web servers. It cannot be changed into text files.
anonymous
2009-09-17 22:22:28 UTC
Just change the extension to *.html and you should be able to edit in any good HTML editor. PHP was just used to generate the page for the browser. Many when saved to a computer get an extension like "*.php.html".



Good editors (FrontPage sucks)...



Editors:



Free HTML Editors, Web Editors, and WYSIWYG Web Editors and Site Builders:

http://www.thefreecountry.com/webmaster/htmleditors.shtml#htmleditors

HTML Editor Reviews - http://www.wdvl.com/Reviews/HTML/

Free Online Editor Tool: http://htmledit.squarefree.com/

Free Flash Website Builder (Online): http://www.wix.com/

PageBreeze (Free visual (WYSIWYG) and HTML tag/source modes): http://www.pagebreeze.com/



Notepad++ (Free source code editor and Notepad replacement that supports several languages): http://notepad-plus.sourceforge.net/uk/site.htm

Serif WebPlus SE: http://myrtc.blogspot.com/2009/08/review-serif-webplus-se.html

Why Validate?: http://validator.w3.org/docs/why.html



Download Trellian WebPage (Free): http://www.trellian.com/webpage/download.htm



Mac users might want to download BBedit Lite, a more powerful, and free mac text editor: http://www.barebones.com/products/bbedit_lite.html



Ron
JD
2009-09-17 15:41:26 UTC
hey buddy



the PHP files are ur HTML files with coding in tht so as per the coding style it can be either PHP, ASP, ASPX.... and the list goes on ;-)



and yes u can edit the PHP files but u need different Editor for tht use Edit Plus it's superb!!



but there might be an issues in those files as most of them are having include functionality means they are including other file inside tht file like ur header and footer so if u wanna to do some editing on tht too u need to locate tht file first and then do the changes in tht as well :)



so happy editing ;-)



cheers!!!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...