Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Archive for Październik, 2011

CodeForest.net: Obfuscate your e-mail address with PHP, JavaScript and CSS

CodeForest.net: Obfuscate your e-mail address with PHP, JavaScript and CSS

A new post on CodeForest.net today gives you a technique for obfuscating email addresses with a combination of PHP, CSS and Javascript. It uses ROT13 for the obfuscation and some tricky CSS to keep it usable for the human visitors.

According to Wikipedia, more than 97% of all e-mails sent over the net are unwanted. That’s around 200 billion spam messages per day. To keep this insane amount of spam out of your inbox, you should keep your e-mail safe when you display it on web. One of the ways to keep it safe is to obfuscate it. In this tutorial I’ll show you how to create a script that will do just that.

The script converts the email address into a ROT13 obfuscated versions and reverse it. The spam bots harvesting addresses won’t see it as a valid format but the user, thanks to some CSS rules, will see it and be able to copy it easily. Each part of the script is explained in the post and you can see a demo of it in action here.

Source: http://www.phpdeveloper.org/news/17046

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Pavel Shevaev’s Blog: Make php-fpm execute arbitrary PHP scripts via socket

Pavel Shevaev’s Blog: Make php-fpm execute arbitrary PHP scripts via socket

Pavel Shevaev has a quick new post to his blog showing how to get PHP-FPM to execute PHP scripts via a socket request.

We are using APC cache very heavily in our projects and during project deployment the cache must be flushed and warmed up. A common solution to warmup the APC cache is to fetch some special page via HTTP which does the job. The problem with this approach is that it’s not reliable enough when PHP is served via several fastcgi back-ends.

To solve the problem, he uses a PHP-FPM module to work with the FastCGI socket and execute any file (as permissions allow, of course). In his case, he uses it to “warm up” his APC cache for the user. A code snippet is provided as an example.

Source: http://www.phpdeveloper.org/news/17045

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

ZendCasts.com: Building a JSON Endpoint with SLIM (Part 1)

ZendCasts.com: Building a JSON Endpoint with SLIM (Part 1)

On ZendCasts.com today, the next part of their series looking at using the Slim microframework has been posted. This is part one of a tutorial building a JSON endpoint for a web service.

You’ll need some of the base that he created in this previous screencast to follow along (the basic structure, really). His takes his basic “hello world” application and builds on it to add a “model” to pull name data from and has the “/names” action respond with a JSON-formatted message (and an “application/json” content-type). His “model” pulls the data out with findAll() and find() methods.

You can grab the source to follow along.

Source: http://www.phpdeveloper.org/news/17044

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Symfony Blog: All symfony 1.x versions available on Github

Symfony Blog: All symfony 1.x versions available on Github

Fabien Potencier has made an announcement on the Symfony Blog today about all the availability of previous Symfony versions on github.

symfony1 is well and alive and many developers are now using it for projects hosted on Git. But as the official symfony 1 repository is hosted on Subversion, it’s not always easy to get things versioned easily. As of today, this becomes much more easier. If you are using Git and symfony1, you can now use the official symfony1 Git clone.

There are branches for each of the major 1.x releases as well as tags for some of the minor releases. You can, of course, still access the latest packages directly via the symfony website.

Source: http://www.phpdeveloper.org/news/17043

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

DZone.com: Debate – How to Interface the PHP World

DZone.com: Debate – How to Interface the PHP World

In a new post to DZone.com today Mitchell Pronschinske responds to some comments that were made by Lukas Smith about working with interfaces in PHP and what he sees as an ideal “drop in” solution.

The PHP community was reacting to Lukas Smith’s “Interfacing the PHP world” for most of last weekend. [...] It’s a pretty major propositon to start ‘interfacing the PHP’ world. Catch up on the conversation and let us know what you think.

Mitchell summarizes Lukas’ thoughts into three points – interfaces in separate repositories, PHP frameworks not adopting 5.3 yet and the customization of method names/naming conventions across frameworks and tools. Another response to Lukas came from Herman Radtke with Lukas following up his original post with “Why Bother?”

Source: http://www.phpdeveloper.org/news/17042

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Community News: Latest Releases from PHPClasses.org

Community News: Latest Releases from PHPClasses.org

Source: http://www.phpdeveloper.org/news/17041

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Justin Carmony’s Blog: Setting Up Nginx & PHP-FPM on Ubuntu 10.04

Justin Carmony’s Blog: Setting Up Nginx & PHP-FPM on Ubuntu 10.04

Justin Carmony has a new tutorial posted to his blog today about setting up Nginx and PHP-FPM on Ubuntu in a few easy steps (thanks to some package management).

This is another wonderful setup that I’ve found myself using rather than the traditional Apache & mod_php setup. [...] Ngnix, unlike Apache, doesn’t actually load PHP. Instead, it hands it off as a proxy to a “php handler” which acts like an Application Server. So nginx by itself won’t serve PHP files, but just static files.

He briefly introduces Nginx and PHP-FPM for those not familiar and points out that this combination is very fast, even without much configuration. The packages are installed with the aptitude installer and minimal changes are made to the php-fm and nginx configuration files (mostly to set up whatever your domain/virtual host is).

Source: http://www.phpdeveloper.org/news/17040

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Fabien Potencier’s Blog: What is Symfony2?

Fabien Potencier’s Blog: What is Symfony2?

Fabien Potencier of the Symfony project (framework) recently made a presentation at the Symfony Day conference and answered the question “what is Symfony2?”

When I ask people what Symfony2 is for them, most of them say something along the lines of: Symfony2 is a full-stack web framework written in PHP. Some also add that this is an MVC framework. And some others add that this is a decoupled framework. This is all fine and correct. But my definition is a bit different. Let me tell you what it is and why I think it matters. Symfony2 is really about two different things.

His “two things” are simple – first that Symfony2 is a “reusable set of standalone, decoupled, and cohesive PHP components that solve common web development problems” and second that the framework is, based on these components, a full-stack framework. He also answers a common question about the framework – is is really MVC? He explains that the framework is less about adhering to a design pattern and more about being useful as a HTTP framework (request and response). He finishes off the post with some thoughts on the framework’s place in “the enterprise”, innovation, reusing standard, well-tested tools and some reasons why to choose Symfony for your next project.

Source: http://www.phpdeveloper.org/news/17039

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Script-Tutorials.com: Creating a Smooth Curve Graphs with PHP and GD

Script-Tutorials.com: Creating a Smooth Curve Graphs with PHP and GD

On Script-Tutorials.com there’s a new tutorial posted showing you how you can get better curves on your graphs with PHP and GD (the key is in the “CubicSplines” class, providing a few extra calculations to make “splines”, a mathematical method for smoothing out values).

Today I have new article for PHP. I will tell you about drawing graphs with GD. Plus – we will smooth our graph with curve lines using cubic splines interpolation method. You can read more about method at Wikipedia.

All of the code is included in the post, ready for cop and pasting – the HTML, CSS plus the PHP to generate the graph, plot the points and apply the cubic splines values. You can check out a live demo of it in action or just download the code and get started on your own.

Source: http://www.phpdeveloper.org/news/17038

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

PHPMaster.com: Understanding OAuth – Tweeting from Scratch, Part 2

PHPMaster.com: Understanding OAuth – Tweeting from Scratch, Part 2

On PHPMaster.com today they’re posted the second part of their OAuth series showing you how to use the authentication mechanism to connect to Twitter’s API. (Part one is here.

Welcome back to Understanding OAuth – Tweeting from Scratch. This is Part 2 of the two-part series and picks up right where we left off in Part 1 with your returned Access Credentials. Since obtaining the credentials is the grueling part of the process, there’s not much more left to do except posting a tweet on the user’s behalf. Hopefully you’ll find the final steps to be a lot easier to follow and more fun to implement.

They show you how to store the credentials from Part 1 into your session for safe keeping and include a simple form you will use to send a tweet to Twitter. They choose to manually build the HTTP POST request, including the credential headers along with the payload (oauth_consumer_key, oauth_signature, oauth_token, etc).

Source: http://www.phpdeveloper.org/news/17037

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>