How to Use Kompozer for PHP Files
Kompozer is a cross-platform, "What You See is What You Get" (WYSIWYG) web page authoring tool. Kompozer can trace its origins back to Netscape's Communicator suite, which included a web browser, email client, address book, calendar and an HTML editor called Composer. Versions of Kompozer are available for Windows, Mac OS X and Linux operating systems. Creating web pages with Kompozer can be as easy as creating documents with a modern word processor; no need to know HTML. Kompozer's source code mode allows more advanced users to edit raw HTML or add code for scripting languages like JavaScript or PHP.
Things You'll Need
- Kompozer Version 0.8b3 or later
- Web Server With PHP
- FTP File Transfer Protocol application
Instructions
-
-
1
Launch the Kompozer application. Click on the "New" icon to create a new page.
-
2
Click the "Design" tab in the lower-left corner of the work area. In the work area, type "The PHP code is below." Press the "Enter" or "Return" key.
-
-
3
Click the "Save" icon. In the "Page Title" input box, type "PHP Kompozer Test." Click OK. In the "Save Page As" dialog box, enter "test.php" as the file name. Click the "Save" icon.
-
4
Click on the "Source" tab at the bottom left corner of the work area. Click the space beside the <br> tag beneath the text "The PHP code is below:" and press "Enter" three times.
Enter the following code in the blank line just made:
<?php echo "<h1>PHP and Kompozer!</h1>"; ?>
-
5
Click on the "Save" icon. Click on the File menu and select "Quit" to close Kompozer.
-
6
Launch the FTP application and log in to the web server. Upload the file "test.php" to the root directory of the web server.
-
7
Click on the "Disconnect" button of the FTP application.
-
8
Launch a web browser and enter the appropriate URL to access the PHP file. Example enter:
http://yourdomainname.com/test.php
Replace "yourdomainname.com" with the domain name or IP address of the web server.
-
9
Press the enter key to load the URL and run the PHP file. The browser should display something like the following:
The PHP code is below:
PHP and Kompozer!
-
1
Tips & Warnings
You can publish an entire website using Kompozer's built-in FTP utility. The publisher wizard requires a site name, site URL, the FTP server address, username, password, the location of the files to be uploaded and the final location of the files on the server -- the same information required for a stand-alone FTP application.
At times, Kompozer will make unrequested changes to your HTML code during file saves. While these changes are syntactically correct, they may affect the way your code displays under different browsers. Kompozer may change "<" or ">" into their HTML entity counter parts, "<" and ">". Sometimes Kompozer will replace the "&s" used to separate variables embedded in a URL with the "&" HTML entity. This may crash the target PHP application or cause unexpected results. Always review and test your PHP code thoroughly when using Kompozer to make sure everything works as you intend and expect.
References
Resources
- Photo Credit Comstock/Comstock/Getty Images