 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Sameer Borate's Blog: How not to create a Random string
by Chris Cornutt November 26, 2010 @ 10:18:48
In this latest post to his blog, Samer Borate talks about how not to create random strings and how, if you're not careful, it could backfire on you.
It is surprising to see how after all the code floating around people still find it hard to create random numbers. In a recent piece of code I encountered, the following was used to generate a string of random numbers. The code was written to provide a random string to be passed to a email verifier system - the type wherein a new user when he subscribes to a website needs to verify his email by clicking on a provided link.
He includes a snippet of the code that uses a call to str_shuffle on the set of numbers 1-10 to generate a random number. The only problem with the method is that, when the number gets large enough, PHP would automatically kick it into exponential format - not exactly ideal for an email link. Let this serve as a reminder for any scripts you might make that are similar.
voice your opinion now!
random string hownotto example email link
PHPBuilder.com: Build a PHP Link Scraper with cURL
by Chris Cornutt January 15, 2010 @ 10:02:45
On PHPBuilder.com today there's a new tutorial posted about building a link scraping script with the combination of PHP and cURL (the script pulls in a page, grabs all of the links off of it and follows them, etc).
I actually built this a few years ago because I had grandiose visions of becoming the next Google. Clearly, that did not happen, mostly because my localhost, database, and bandwidth are not infinite. Yet this little robot has quite interesting applications and uses if you really have the time to play with and fine-tune it.
You'll need to have cURL support built into your PHP installation to get the scripts working, but the actual code itself is pretty simple. Curl and XPath do most of the heavy lifting of finding and following the links and its easy enough to drop them into a MySQL table from there. You can download the source here.
voice your opinion now!
link scraper curl xpath mysql tutorial
NETTUTS.com: Creating an Advanced Password Recovery Utility
by Chris Cornutt May 06, 2009 @ 08:47:49
On the NETTUTS site today there's a new article (continuing on from this tutorial) looking at how to make a "forgot your password" system to add on to their current login technique.
In my last tutorial, 'A Better Login System', a few people commented on how they would like to see a tutorial on password recovery, which is something you don't always see in user access tutorials. The tutorial I am bringing you today will deal with just that. Using mySQLi, we will learn to recover unencrypted and (one-way) encrypted passwords.
They give you what you'll need to set up the database for the user information and the PHP code you'll need to connect to it and fetch the user's information. The script then generates an email with a custom link that will take the user to a page asking them to answer a security question before they can continue.
voice your opinion now!
password recovery security question link email login
TotalPHP.com: How to Read an RSS Feed with PHP 5
by Chris Cornutt April 22, 2009 @ 11:15:16
New on the TotalPHP blog today is this article talking about reading RSS feeds with PHP (more specifically with SimpleXML).
PHP 5's ability to read XML files is fantastically easy to use. In the past it was possible but it required quite a bit of long winded code to get any where. PHP 5's SimpleXmlElement function makes working with XML a breeze, and with much less code too!
They include a script as an example - five lines to completely parse and pull the title and link information out of the remote RSS file. The example creates a SimpleXML object using the feed's URL and makes each element inside accessible as an object (that can be looped through and properties can be checked on).
voice your opinion now!
title link object example simplexml php5 read rss
phpPro.org: Embedding PHP In CSS
by Chris Cornutt April 13, 2009 @ 12:05:52
New on the phpPro site is this article looking at a technique for embedding PHP inside of your CSS files and have it correctly interpreted.
Perhaps one of the most frustrating aspects of using PHP with websites, is getting variables into CSS. Having variables stored in an ini file, config file or even a database can make the updating of the look and feel of a site simple, however, CSS files, by default, do not parse PHP. [...] A html file may also include a PHP file, in the same manner as it includes a CSS file. This means the stylesheet can be renamed from style.css to style.php.
Using this method, the PHP inside the file is parsed and, because its included with a link tag, the CSS is also made available to the rest of the page.
voice your opinion now!
embed css link parse webserver
Noupe.com: Beautiful Forms - Design, Style, & make it work with PHP & Ajax
by Chris Cornutt March 10, 2009 @ 07:57:29
In this new article from Noupe.com they link to several resources that can help you make your site's forms a bit "more beautiful" by combining PHP and Ajax (and Javascript).
Forms needs a solid visual structure, a profound hierarchy of form elements (Fields and Labels), powerful techniques and Functionality (AJAX) to make the form look and work creatively. [...] Today we wanted to share with you some great steps to get the perfect form: we will go through designing and usability you need to keep in mind, styling your form, spicing it up with some nice javascript effects, validating user's input and finally getting it to work using PHP and Ajax.
Some of the links include:
Most of the article links also include links to demos of the tutorial/application in action.
voice your opinion now!
form design style functional ajax javascript link tutorial
Symfony Blog: Cross Application Links
by Chris Cornutt February 19, 2009 @ 12:56:08
Fabien Potencier has recently posted a tutorial over on the symfony blog about using cross-application links in your application:
A symfony project is made of one or more applications. Applications share nothing, but the model classes. But, even if the symfony documentation is crystal clear on the subject, many developers want to share more than just the model. The most requested feature being the ability to create links to a frontend application from a backend one.
This sort of linking is relatively simple in the 1.1 release of the framework - its instances of sfRoutingConfigHandler and sfPatternRouting that let you create the configuration classes (and code) to grab information and functionality from one application to another.
voice your opinion now!
symfony cross application link route configuration
Community News: PHPCamp.net Launched
by Chris Cornutt January 26, 2009 @ 11:17:55
Amit Singh dropped me a note to let me know about a new community site he's developed to share PHP-related resources from all around the web (similar to DZone) called PHPCamp.net.
PHPcamp aims to provide a platform where everyone can bring interesting links, news and share their knowledge that are helpful to other web developers. It provides publishers with a chance to easily show their articles to others and gain some readers; most importantly it provides readers an easy way to keep an eye on latest things in PHP world, at the same time, giving them a chance to learn new things every day.
The site takes in user-submitted articles/blog posts/etc and they're dropped into the "freshly arrived" list for public consumption. If a link gets enough attention, its listed under the "getting hotter" and "boiling" sections progressively. Check out their blog for more information.
voice your opinion now!
link phpcamp aggregate user contribute website resource blog entry
|
Community Events
Don't see your event here? Let us know!
|