796 shaares
58 results
tagged
Php
If you’ve ever integrated with another API that requires security (such as Twitter), you’ve probably consumed an OAuth service. In this article, I’ll explore what it takes to create your own three-legged OAuth server allowing you, for example, to create your own secure API which you can release publicly.
When dealing with OAuth, you will typically see it implemented as a two-legged or three-legged OAuth server. The major difference between them is that two-legged authentication doesn’t involve another user. For example, if you want to access a specific user’s Twitter information, you would consume the three-legged server because an access token must be generated for the user in your application, versus just Twitter providing you a token. We’ll focus on the three-legged variety since it’s more practical for real-world use.
We’ll use oauth-php to perform a lot of the heavy lifting for us. The library is hosted on Google Code and is not listed in Packagist, but it can still be installed using Composer. For details, check out the composer.json file in code that accompanies this article available from the PHPMaster.com GitHub account.
When dealing with OAuth, you will typically see it implemented as a two-legged or three-legged OAuth server. The major difference between them is that two-legged authentication doesn’t involve another user. For example, if you want to access a specific user’s Twitter information, you would consume the three-legged server because an access token must be generated for the user in your application, versus just Twitter providing you a token. We’ll focus on the three-legged variety since it’s more practical for real-world use.
We’ll use oauth-php to perform a lot of the heavy lifting for us. The library is hosted on Google Code and is not listed in Packagist, but it can still be installed using Composer. For details, check out the composer.json file in code that accompanies this article available from the PHPMaster.com GitHub account.
When I started writing for PHPMaster, my first article was about Zend Framework. Since then, the framework has released version 2 stable. Apart from the name, version 2 is really a new project compared to the older version; ZF has been totally rewritten. In this article I’ll give you an overview of the new features and the changes that have been introduced.
The first PHP 5.5 alpha has been publicly released. After having some time to test and experiment with it, we can now bring you our in-depth overview of what to look forward for!
PHP is the most popular language for web development, but a common criticism against it used to be that it lacked a suitable debugger. Developers using languages like Java and C# enjoy a powerful suite of debugging tools, often integrated directly with their IDEs. But the disconnected nature of web servers and PHP IDEs prevented us from having many of the same tools available. We manually added debug statements in our code… until Xdebug filled the void.
Xdebug is a free and open source project by Derick Rethans and is probably one of the most useful PHP extensions. It provides more than just basic debugging support, but also stack traces, profiling, code coverage, and so on. In this article you’ll see how to install and configure Xdebug, how to debug your PHP application from Netbeans, and how to read a profiling report in KCachegrind.
Xdebug is a free and open source project by Derick Rethans and is probably one of the most useful PHP extensions. It provides more than just basic debugging support, but also stack traces, profiling, code coverage, and so on. In this article you’ll see how to install and configure Xdebug, how to debug your PHP application from Netbeans, and how to read a profiling report in KCachegrind.
In a previous article, I talked about some common security vulnerabilities that can affect your PHP web application. But there are other things besides those ten (okay, seven) attacks to think about when you’re developing. And so, this article offers a compendium of miscellaneous things that are security related; things you should do, things you shouldn’t do, things that other people might try to do, whatever it takes to make an article long enough for my editor to be satisfied with it.
Imagine a namespace as a drawer in which you can put all kinds of things: a pencil, a ruler, a piece of paper and so forth. These are your belongings. Directly underneath your drawer is someone else’s, and he puts the same things in it. To avoid using each other’s items, you decide to label the drawers so it’s clear what belongs to whom.
Previously, developers had to use underscores in their classes, functions and constants to separate code bases. That’s equivalent to labeling each others belongings and putting them in one big drawer. Sure, it’s at least some kind of organization, but it’s very inefficient.
Previously, developers had to use underscores in their classes, functions and constants to separate code bases. That’s equivalent to labeling each others belongings and putting them in one big drawer. Sure, it’s at least some kind of organization, but it’s very inefficient.
Security is not a list of things you do. Security is a way of thinking, a way of looking at things, a way of dealing with the world that says “I don’t know how they’ll do it, but I know they’re going to try to screw me” and then, rather than dissolving into an existential funk, being proactive to prevent the problem.
But, you can’t buck statistics. Nobody is going to read an article entitled “Coding for Security.” Everyone wants an article with a number in it: “The 8 Most Common PHP Security Attacks and How to Avoid Them”, “23 Things Not to Say to a Super Model”, and “15 Reasons to Avoid Radiation Poisoning.” So, here goes, the “Top 10 PHP Security Vulnerabilities.”
But, you can’t buck statistics. Nobody is going to read an article entitled “Coding for Security.” Everyone wants an article with a number in it: “The 8 Most Common PHP Security Attacks and How to Avoid Them”, “23 Things Not to Say to a Super Model”, and “15 Reasons to Avoid Radiation Poisoning.” So, here goes, the “Top 10 PHP Security Vulnerabilities.”
In this article we will see how to calculate the MD5 hash of any file using PHP. We have core function availble in PHP to create a MD5 hash of any file.
What are the most surprisingly useful PHP functions?
I was especially happy when I found out about implode() to join arrays together into a string.
I was especially happy when I found out about implode() to join arrays together into a string.
PhpMyCodeGenerator is a code generator framework, which allows you to create code generators as PHP functions and provide input to the code generators through an Excel file. PhpMyCellScript allows you to write programs directly in Excel.
Project providing a set of classes for the PHP programming language, which allow you to write to and read from different spreadsheet file formats, like Excel (BIFF) .xls, Excel 2007 (OfficeOpenXML) .xlsx, CSV, Libre/OpenOffice Calc .ods, Gnumeric, PDF, HTML, ... This project is built around Microsoft's OpenXML standard and PHP.
In this tutorial I will show you how to detect and display the visitor`s preferable language in PHP. I think that language detection is one of important features of any serious multilanguage website. As minimum – you can set necessary language for website interface for your visitors. Our script will show you one of 180 possible languages (depends on your browser’s preferences. Ready? Lets start.
Have you ever taken a look at the list of functions available in PHP? I just counted 5025 on the PHP quick reference page. Granted, it depends on what extensions you have enabled, but still: that’s one heap of functions! While I can’t show you every one of them, if you’re new to the language, I’ll introduce you to seven really handy ones in this quick tip!
The goal of the Standard PHP Library-or SPL, in brief-is to provide a standard library of interfaces which allows developers to take full advantage of object-oriented programming in PHP 5.
This library of interfaces creates a standard API for certain kinds of built-in functionality, allowing your classes to interact with the PHP engine in a much more seamless manner. The functionality it provides includes, (for example) is the ability to define how your objects will react when iterated over for each, advanced array access, file and directory access, and advanced SimpleXML object handling.
This library of interfaces creates a standard API for certain kinds of built-in functionality, allowing your classes to interact with the PHP engine in a much more seamless manner. The functionality it provides includes, (for example) is the ability to define how your objects will react when iterated over for each, advanced array access, file and directory access, and advanced SimpleXML object handling.
In this tutorial, our goal is to create an FTP class with PHP that is well written, useful, and expandable.
In previous post I have explined about getting the Facebook page details using Graph API and PHP. Now this post is about to get the Twitter Follower Count using PHP.
For this method what you will need is just and User Name of the Twitter Account. For Example Expert Developer’s Twitter Account is XpertDevelopers.
For this method what you will need is just and User Name of the Twitter Account. For Example Expert Developer’s Twitter Account is XpertDevelopers.
Smarty est un moteur de template pour le langage PHP. Il vous permet de séparer davantage votre logique métier (logique applicative) et la présentation, en supprimant autant que possible le code PHP de vos vues. Certains développeurs et frameworks préfèrent ne pas utiliser un moteur de templates, d’autres au contraire ne préfèrent pas avoir un simple code PHP dans leurs vues.
Ces deux points de vue sont légitimes et compréhensibles, et à la fin, c’est surtout une question de goût. Quoi qu’il en soit, ce n’est jamais une mauvaise idée que d’essayer un nouveau concept avant de décider de l’utiliser ou non.
C’est ce qu’un tutoriel permet de faire, et je vais ainsi vous présenter le framework de template Smarty.
Ces deux points de vue sont légitimes et compréhensibles, et à la fin, c’est surtout une question de goût. Quoi qu’il en soit, ce n’est jamais une mauvaise idée que d’essayer un nouveau concept avant de décider de l’utiliser ou non.
C’est ce qu’un tutoriel permet de faire, et je vais ainsi vous présenter le framework de template Smarty.
Gravatar stands for Globally Recognized Avatar. This is the very well known service to show your avatar globally.
You can get Gravatar using an email address. In this post I am going to show you how to show the gravatar using an email address.
I am going to cover this post with PHP.
You can get Gravatar using an email address. In this post I am going to show you how to show the gravatar using an email address.
I am going to cover this post with PHP.
Here is the simple trick to read the text file line by line. For this I am going to use the fopen() and fgets() function.
This is code snippet I am going to take one text file and read it line by line.
This is code snippet I am going to take one text file and read it line by line.
There is a big difference in these functions. Actually both functions perform the same task which includes the file but the process of including the file a quite different.