Skip to main content

Posts

Why PHP ?

If you want to use PHP in your company and your manager favours another solution, or if you are trying to convince a potential client that PHP really is a superior choice for the web, you are going to need to have a clear-cut set of reasons why you believe PHP is the superior language. This short list should help you get started: PHP is cross-platform. It can be run on Windows, Linux, BSD, Mac OS X, and Solaris, as well as a variety of other platforms. PHP is free. You can download the source code, use it, and even make changes to it without ever having to pay any licensing costs. You can even give away your own modified version of PHP. Note to critics: just because PHP is free, it does not mean you need to give your scripts away for free. PHP is fast. In the majority of scripts beyond basic benchmarks, PHP will easily compete with both Perl and Python, and usually pull ahead of Microsoft's ASP.NET by about 10-15%. Add to that the fact that PHP code can be cached for execution,...

Ultimate htaccess Examples

Heres the actual code that I use when I'm developing sites for clients This lets google crawl the page, lets me access the whole site (24.205.23.222) without a password, and lets my client access the page WITH a password. It also allows for XHTML and CSS validation! (w3.org) # ELITE HTACCESS FOR WEBDEVELOPERS ############################################## AuthName "SiteName Administration" AuthUserFile /home/sitename.com/.htpasswd AuthType basic Require valid-user Order deny,allow Deny from all Allow from 24\.205\.23\.222 Allow from w3.org htmlhelp.com Allow from googlebot.com Satisfy Any Each code snippet has been copied from htaccesselite. Additional and detailed info on each htaccess code snippet can be found at askapache.com NOTE: Most of these snippets can be used with a Files or Filesmatch directive to only apply to certain files. NOTE: Any htaccess rewrite examples should always begin with: Options +FollowSymLinks RewriteEngine On RewriteBase / ...

PHP IDE

NuSphere PhpED 5.0 Commercial Windows Linux 5/5 PHP Edit 2.10 Commercial Windows 5/5 PHP Designer 2005 3.0.6 Commercial Other Windows 5/5 ActiveState Komodo 3.5 Commercial Other Windows Unix Linux Other 5/5 Maguma Workbench 2.6 Commercial Windows Linux Mac 5/5 Bluefish 1.0 Other Unix Linux Mac 5/5 emacs 21 Freeware Windows Unix Linux Mac Other 5/5 NuSphere Nu-Coder 1.4 Commercial Other Windows 5/5 Dreamweaver 8 Commercial Windows Mac Other 5/5 TSW WebCoder 2005 2005 Commercial Other Windows 5/5 Maguma Studio Pro 1.3.X Commercial Windows 4/5 Maguma Studio Free 1.1.0 Freeware Windows 4/5 PHP Editor by EngInSite 3 Shareware Commercial Windows 4/5 PHP Eclipse 1.06a Freeware Unix Linux 4/5 Xored:: WebStudio 0.3.4 Freeware Windows Unix Linux Other 4/5 SciTE 1.53 Freeware Windows Unix Linux Other 4/5 VS.Php Beta 3 Commercial Other Windows 4/5 Macromedia HomeSite 5.5 Commercial Windows 4/5 Kate 2.2 Freeware Linux 4/5 TextPad 4.7.2 Freeware Commercial Windows 4/5 Dav...

Can I run a PHP script on cron?

Yes, you can run a PHP script on cron. Look here to see how to setup your own crontab. If your PHP scripts do not have executable permissions, 644 or -rw-r--r-- for example, then as part of the command portion of the cron line, you must specify the php interpreter and pass it the filename of the PHP script (including full path to the script from your home directory) that you want executed, like so: 28 14 * * * /usr/local/bin/php -q /myscript.phtml 6 3 20 4 * /usr/local/bin/php -q /htdocs/www/x.php The first cron line above will run myscript.phtml located in your home directory every day at 2:28PM. The second line will run the script x.php from your /htdocs/www/ directory once a year on April 20th at 3:06AM. When you explicitly specify the php interpreter /usr/local/bin/php your scripts need not have filenames ending in .php .phtml .php3 .php4. Conversely, if your script filenames do not end in one of those PHP extensions, then you must explicitly use the php interpreter in the command ...

Eclipse - an open development platform

Eclipse is an open source community whose projects are focused on building an open development platform comprised of extensible frameworks, tools and runtimes for building, deploying and managing software across the lifecycle. A large and vibrant ecosystem of major technology vendors, innovative start-ups, universities, research institutions and individuals extend, complement and support the Eclipse platform. New to Eclipse? Enterprise Development Embedded + Device Development Equinox Runtimes Application Frameworks Language IDE

Writing Scalable Applications with PHP

The first part of this article, "Real-World PHP Security", appeared in the April 2004 issue of Linux Journal and covered the subject of secure PHP development. This article takes you, the professional PHP developer, one step further, by providing detailed explanations and reliable source code that illustrate the steps to follow in order to develop successful PHP applications. One day or another, every developer faces a situation in which he/she is responsible for extending the functionality of an existing application or prepare an application for an increase in use and traffic (scaling up). Our goal today is to make this process trivial by learning to develop applications based on a clean, elegant and modular design that is secure, reliable and flexible while keeping it all simple. Please refer to Figure 1, previously introduced in "Real World PHP Security" and included below. Figure 1. Our Application Model Diagram Cleaning Up the Operating Environment As a...

Running PHP Scripts with Cron

Lots of programmers like PHP for its ability to code and develop web applications fast. Code-debugging is a lot easier than with PERL or C. However, there is one thing a lot of developers are puzzled about, “How to run PHP Scripts with crontab?” Cron is normally available on all Unix and Linux distributions; if you cannot access it, contact your root or server administrator. It is a daemon which allows you to schedule a program or script for a specific time of execution. If you want to learn more about cron, click here or type “man crontab” at your command prompt. I have found myself in the need to run PHP scripts at specific times. For example, to update the content of a website, to remove expired articles, to send out e-mails on a given date and a lot more. While some may think that this is were PHP is doomed, I will show you how it’s done. A Manual crontab? The first solution that came to my mind was to run the script directly from my browser (e.g. http://www.mydomain.com/script.php...