background preloader

PHP

Facebook Twitter

PHP 5.4′s New Built-in Web Server. One of the more interesting facilities provided in PHP 5.4 is a built-in web server. It runs from the command line on Windows, Mac or Linux. You just need to ‘cd’ to the folder where your application resides then execute: php -S localhost:8000 This will start a console-based web server. The document root is located in the current folder: PHP 5.4.0 Development Server started at Mon Dec 19 11:56:05 2011 Listening on localhost:8000 Document root is /home/owner/myapp Press Ctrl-C to quit You can then open in your browser. It’s also possible to specify a PHP “router” file on the command line, e.g. php -S localhost:8000 -t .

The server analyzes the output of routing.php: If the script returns false, the requested resource (or 404) is returned as-is.If the script returns anything else, that output is returned to the browser. For example, the following router script will return image files but all other requests will display “Welcome to the PHP Server!” <? Contributing Editor. Securing PHP Applications Part II – Securing PHP code | PHP Code. 5. SQL injectionsWhat is it? This type of attack is one of the most common attacks.

SQL injections occur after two failures of the part of developers: failure to filter data as it enters the application (filter input) and failure to escape data as it is sent to the database (escape output). For example, let’s suppose we have the following query: If this query is sent to MySQL the following error is displayed: You have an error in your SQL syntax. Now, the user finds out information about two columns of your database table and knows which is your full WHERE clause. If he knows a user or many is even easier. How should I protect my application from it? 6.

For example, this type of attack can come from a link like this: <a href= A user clicks on this link and goes to your site. How should I protect my application from it? 6.2. How should I protect my application from it? - IP addres verification This is very similar to user agent verification. 6.3. 7. 8. 9. <? Dropbox PHP - Une classe PHP pour gérer votre Dropbox. Dropbox PHP est une librairie PHP permettant d'interagir facilement avec votre compte dropbox et les fichiers qui s'y trouvent.

Vous êtes sans doute comme moi, un grand consommateur des services dropbox pour partager vos fichiers sur plusieurs machines très simplement. Voici une classe PHP qui peut s'avérer très intéressante pour contrôler avec une application PHP vos fichiers partagés sur Dropbox. Gérer par exemple un système de partage de fichier interne à une entreprise depuis un Intranet PHP ... Les possibilités sont infinies, et cette classe PHP bien pratique vous permettra de contrôler facilement votre Dropbox. Dropbox PHP propose notamment les fonctions suivantes: Pour s'authentifier à votre compte, la librairie prévoit l'interfaçage avec le système Oauth de dropbox. Voici un exemple d'utilisation de la librairie pour télécharger une image: 02. 03. 05.include 'Dropbox/autoload.php'; 07. 13. 15.header('Content-Type: text/plain'); 17. 20. 22.header('Content-Type: image/jpeg'); Site Officiel.

PhpForm - Un générateur de formulaire XHTML, CSS et JS complet - PhpForm est un service en ligne gratuit qui vous permettra de générer rapidement des formulaires XHTML et CSS bien conçus, prêts à être intégrés dans vos applications web. Dans un premier temps, vous aurez la possibilité de choisir quel style vous souhaitez donner à votre formulaire. Le choix des couleurs est assez vaste, vous trouverez sans doute chaussure à votre pied ! Dans l'étape suivante, vous pourrez choisir les différents éléments qui constitueront votre formulaire: Input texte simpleTextareaChoix multiples: Radio / CheckboxSelectChamps date et champ heureNuméro de téléphoneSite webEmailZone d'uploadPrixAdresseEtc Une fois que vous avez disposé tous vos champs, vous allez pouvoir les configurer: Changez le titre du label, configurez le type de champ, ses options et le message d'aide qui sera affiché en Javascript lorsque vos visiteurs seront en train de remplir le champ.

Il ne vous restera plus qu'à modifier la propriété "name" des champs et de développer le PHP derrière ! 15 Indispensible Tools For PHP Developers.