Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PHP


  PHP Security

1. IntroductionWriting PHP applications is pretty easy. Most people grasp the syntax rather quickly and will within short time be able to produce a script that works using tutorials, references, books, and help forum forums like the one we have here at PHP Freaks. The problem is that most people forget one of the most important aspects that one must consider when writing PHP applications. Many beginners forget the security aspect of PHP. Generally, your users are nice people, they will do as they are told and you will have no problem with these people whatsoever. However, some people...

30,519 0       PHP SECURITY SQL INJECTION XSS CROSS SIT


  PHP Query String

Query string plays important role in building web applications, especially if you want to make nice urls without question mark and many key, value pairs, actually it is not so easy to design application with nice urls however it is always worth doing so, because it not only looks very proffessional, such URLs are search engine friendly, which means that they will get indexed faster but also it happens that search engines have problems with indexing pages with more then 3 key=value pairs in query string.However, one place where using nice URLs is not necessary are all kinds of admin panels, the...

3,989 0       PHP SECURITY QUERY STRING REQUEST


  PHP Multithreading – Faking It

PHP doesn’t really support multi-threading per se but there are ways to do “fake” multithreading. Here’s one I saw in the PHPClasses.org newsletter – Multi-thread Simulation.Note that this class is intedend for use on a webserver, as opposed to running PHP scripts from a command line (or similar). Check the end of this post for some alternatives you can try if you’re using PHP as a stand-alone scripting language.Now, I’m going to be lazy and just copy the description of the class from the project page :)This class can emulate the execution of prog...

8,715 0       PHP MULTITHREADING POSSIBLE CURL FAKE SI


  Some Thoughts on Twitter's Availability Problems

As a regular user of Twitter I've felt the waves of frustration wash over me these past couple of weeks as the service has been hit by one outage after another. This led me to start pondering the problem space [especially as it relates to what I'm currently working on at work] and deduce that the service must have some serious architectural flaws which have nothing to do with the reason usually thrown about by non-technical pundits (i.e. Ruby on Rails is to blame). Some of my suspicions were confirmed by a recent post on the Twitter developer blog entitled  Twittering about architecture...

2,058 0       TWITTER ARCHITECTURE AVAILABILITY DESIGN


  mysql_fetch_array(),mysql_fetch_assoc() and mysql_fetch_row()

In PHP MySQL mannual. There are three functions which need to be clarified for some users who may get confused when choosing which one to use to get the result.mysql_fetch_array() : by seeting the different parameters, there are three ways to return the result set. MYSQL_ASSOC(Result set with field names as the associative indexs.It means you can use the field name as the index to get value of the specified cell). MYSQL_NUM(Result set with field names as the number indices). Or MYSQL_BOTH(you can use both modes to get value of a specified cell).mysql_fetch_assoc():Result set with field na...

9,201 0       PHP COMPARISON MYSQL RESULTSET MYSQL_FET


  Highly efficient PHP code writing

Next are some tips for writing highly efficient PHP codes. They are described below:0. Use single quote to replace double quote, this will be better since PHP will serach for variables in double quoted strings. Note, only echo can do this;1. If we can define methods of a class as static, then do it. It will increase access speed by 4 times;2. $row["id"] is 7 times faster than $row[id];3. echo is faster than print, and also use echo's multiple parameter format such as echo $str1,$str2 instead of echo $str1.$str2;4. When using for loop, make sure the maximum number of executions instead of calcu...

12,330 3       PHP CODE WRITING HIGH EFFICIENT TIPS


  Creating a PHP 5 Extension with Visual C++ 2005

This article describes the steps to create a custom PHP extension DLL for the Windows platform. The Zend API documentation that comes with PHP 5 on Windows (see php_manual_en.chm) does a good job explaining how to write extension methods, parse method parameters, and return values. But there is not currently a good step-by-step tutorial on how to get your first extension project up and running on Windows. The aim of this article is to fill that gap.PrerequisitesVisual Studio 2005You can alternately use the free Visual C++ Express Edition or the VC++ 8 compiler in the Windows SDK v6.0 if youâ...

4,359 0       PHP WINDOWS EXTENSION WRITING STEP BY ST


  PHP function overloading puzzle clearer

PHP's meaning of overloading is different than Java's. In PHP, overloading means that you are able to add object members at runtime, by implementing some of the __magic methods, like __get, __set, __call, __callStatic. You load objects with new members. Overloading in PHP provides means to dynamically "create" properties and methods. These dynamic entities are processed via magic methods one can establish in a class for various action types.Some example:class Foo{    public function __call($method, $args)    {        echo "Called method $method";&n...

3,805 0       PHP OOP FUNCTION OVERLOADING DEFAULT VAL