Thursday, January 29, 2009

Dynamic Image Generation

Long and boring back-story....

One of the standard features of a message board is allowing members to have a signature, which is appended to the bottom of each post they make. Posters can put whatever they want into the signature (within forum settings). Putting quotes in one's signature is one of the more popular things to do.

A lot of people put in some motto they live by, some funny quote by some famous person, whatever. Some people like to quote things other posters on the board have said. I am one of those people. I think it's fun and promotes a sense of belonging to the community.

I've been a member of the phpfreaks forum for a number of years now, and over the years, I have posted and come across quotes that were (to me, anyways) worth collecting. But having a bunch of quotes in a sig isn't very convenient.

Click Here to Read Full Article from www.phpfreaks.com

Tuesday, January 27, 2009

MySQL University

MySQL University is a series of free web seminars. Each week (on Thursdays) you have a unique opportunity to learn something interesting from MySQL developers and professionals.

MySQL University sessions cover wide range of topics including server administration, extending MySQL functionality, or just tips for better performance of your queries.

The sessions are conducted using DimDim, a web based conference tool build in Flash. It works really good even if your connection is not the fastest one.
During the session, the presenter will show slides and talk about the topic (so it's pretty important that you can understand spoken English), and you and other participants can ask questions using built in chat.
I strongly recommend you to take part in 'live' sessions as it is pretty unique experience, but if for some reason you can't, then there is archive of past sessions, often with flash recording, available at MySQL University's home page.
On the same page you will also find more detailed information on participation, as well as a schedule of upcoming sessions with abstracts and presentation slides, to help you decide if particular subject will be interesting to you or not.

There's also a Google Calendar with MySQL University Schedule available, to which you can subscribe.

From now on, I will (if time permits) post here on PHPfreaks about upcoming sessions that might be interesting for an 'average' PHP developer.

The one that takes place next Thursday is titled 'Scalability Challenges in an InnoDB-based Replication Environment' and seems to be directed more to server administrators. If however, you run your website on a VPS or a dedicated server, you might as well take a look at it.

Have fun!

Thursday, January 22, 2009

Where can I learn about PHP and MySQL ?

The official PHP site is http://www.php.net and the online documentation is found at http://www.php.net/manual

If you would rather follow a tutorial, then check out http://www.devshed.com (this covers PHP and others) or http://www.phpbuilder.com or just do a search on google for PHP Tutorials.

Especially look into how PHP integrates with MySQL so you can program database powered websites. If you are the type of person who likes to dive in the deepend, try downloading some basic scripts from http://www.hotscripts.com and/or http://php.resourceindex.com and start ripping apart the code to see what's being done.

The official MySQL site , is www.mysql.org, also look into a great mysql tutorial at

http://dev.mysql.com/doc/refman/5.0/en/tutorial.html

lastly below is a link to a dozen php and mysql tutorials frm webreference.com http://www.webreference.com/programming/php/

php mysql training cources at Kolkata, India

PHP 5.3 on Windows

Congratulations to the PHP community on its PHP 5.3 alpha 2 release in December. In roughly one month, there have been over 80,000 downloads of the alpha 2 release from unique IP addresses.

You can see that interest in PHP on Windows is growing significantly when you compare this to the 40,000 or so Windows downloads of PHP 5.2 alpha and beta combined over nearly five months.

One of the critical accomplishments in 5.3 has been updating the code base so that the core engine can be built under the latest version of Visual C (VC9). This update has enabled members of the community to focus on optimizing the PHP core to run on Windows. Already, with alpha 2, the release is proving itself to be a stable, robust implementation.

The community anticipates hitting general availability for 5.3 in the spring. Interest in that release is already running high and should continue to grow in the coming weeks.

Source: http://port25.technet.com/archive/2009/01/16/php-5-3-on-windows-update.aspx

Friday, January 16, 2009

PHP Cheat Sheet

The PHP cheat sheet is a one-page reference sheet, listing date format arguments, regular expression syntax and common functions.



You may down load the orginal image from the below links
http://www.addedbytes.com/download/php-cheat-sheet-v1/png/
http://www.addedbytes.com/download/php-cheat-sheet-v2/png/

Find some other interesting and helpful Cheat sheets
http://feeds.feedburner.com/CheatSheets-ILoveJackDanielscom

Maloy Bookmarks

Monday, January 5, 2009

Standardizing Variables to Code Faster

If you’ve been coding for a while you probably have some set ways in which you work. I recommend you also widen this method to naming variables, which when done consistently can be a huge help, especially when you are using some fancy MySQL along with your PHP code. If you are building a site with 15 MySQL tables it is helpful if you know all the column names because you always name them in the same way, but the same thing goes for simple variables, and even ids and classes for HTML elements.

A very common example can be variables which hold a user’s data. In my case I always use the variable ‘$u’ for holding the username, and the variable ‘$p’ for holding the password. If you are grabbing a lot of data, like first name, last name, email and so on you can make up your own standard set, I use ‘$fn’, ‘$ln’ and ‘$e’ respectively for the three.

Since you usually use these variables in the same script the importance of naming them consistently may not seem like a huge time saver. However when you get into session variables it saves you a lot of time if you don’t always have to look at where you are defining them to find out the names of each. I pull user data using a mysql query when a user logs in and I immediately place the whole array in a session variable name “$_SESSION['user']“. The names of the columns represent the values of this array, so the username and email would respectively become “$_SESSION['user']['Username']“, “$_SESSION['user']['Email']“. This is the same in my case for every single website I build where applicable.

User data naming consistency is also very prominent in the MySQL tables themselves. As you can see above my columns are also named the same in each case, a user’s email is always “Email”, his last name is always “LastName”. I steer clear of abbreviations with MySQL tables so other coders can easily see what’s going on as well. Consistency doesn’t just apply to the actual names, you can also apply it to cases. As you can see all my column names are always capitalized, they are like wikiwords, but user session variables which don’t come from MySQL are not capitalized. For example, when a user logs in he is assigned a time, which is usually one hour. If he/she is inactive for more than this time (no refreshes), he/she is logged out. There is no need to store this in the database, and so I know that this is not in there the session variable here is “$_SESSION['user']['time']“. This means that if I come back to work on a site a year after completion I know exactly where variables come from.

Even if you don’t yet know any PHP, you’re just getting into HTML and CSS you can still use these good practices. When assigning ids and classes to elements try and work out a structure for yourself that you always use. I use empty div tags to clear floats a lot, so I have a separate class named “cl” for this purpose. Whenever I start out a new webpage I include this class by default in the stylesheet since I know I will most likely need it.

That’s about it for standardizing your coding work, most of it is just common sense really. Try and work out your own method which works best for you. It takes time and a lot of practice to get a system working well since there is so much to think of, but if you always keep this in mind somewhere while coding you’ll be a faster and better coder in no time at all!

Script2please.com is one of the leading offshore outsourcing companies in India, We Offer Rich php web development services, and custom web development

Source: http://www.ghacks.net/2009/01/02/web-development-standardizing-variables-to-code-faster/