Vijay Joshi's Blog, page 3
January 13, 2011
Wordpress Internal Server Error 500 in wp-admin

If you are getting an internal server error 500 after installing wordpress while accessing admin, here is the fix.
Most likely it is caused by low memory limit on your server. To fix it, create a new file named php.ini in you wp-admin directory and put the following line in it.
memory_limit = 64M
Save the file, then reload the admin page and it will work fine.
Tweet This!Share this on FriendFeedShare this on del.icio.usStumble upon something good? Share it on StumbleUponShare...January 11, 2011
PHP: Shorten URLs using Google URL shortener API

In past 2 posts you saw how short URLs can be expanded using the Google URL shortener API. This post shows how URLs can be shortened using this API.
API key is not mandatory for test purpose. Use this link to get an API key.
For shortening URLs, 2 points must be noted. First, a HTTP POST is required and the post data should be in JSON format. Here is the code:
//This is the URL you want to shorten$longUrl ...Using PHP and cURL to expand URLs using Google URL shortener API

Yesterday I wrote this post explaining how short goo.gl URLs can be expanded using the newly launched goo.gl API. In that code we used php function get_file_contents to get the response from API.
How about implementing the same functionality using cURL now? If you have libcurl support installed with PHP, you are ready to use the cURL functions of PHP.
Here is the code. API key is not mandatory but Google recommends that you use one. It will increase your per day usage limits...
PHP: Expanding URLs using Google URL shortener API

Yesterday. google launched an API for its URL shortening service http://goo.gl. Using this API developers will be able to expand/shorten URLs and get a user's analytics and history programmaticaly.
Below is a small snippet of PHP code that expands a short URL. The response comes in JSON format, so we will use the json_decode function to convert it to object.
$shortUrl = 'http://goo.gl/WlFX';$response ...January 9, 2011
Favorite tech links of the week : 03 Jan – 09 Jan, 2011

This post contains some of the useful and interesting tech links I found during this week. To keep up to date with the latest information, subscribe to the feed or follow me on twitter @v08i
32 Javascript Alternatives with Pure CSS – Updated – http://goo.gl/DNTvy10 Google Chrome Extensions for a Faster Browser – http://goo.gl/slpTR75+ Tools for Visualizing your Data, CSS, Flash, jQuery, PHP – http://goo.gl/K8771Getting Started with HTML Emails – http://goo.gl/kej2h15 Easy G...January 7, 2011
PHP: Defining configuration values

Every web application requires configuration files which contain values that are used throughout the application. In this post we will look at some of the methods developers use to define configuration settings and also what should be avoided.
The ugly wayI have seen many many developers do this and am myself guilty of doing it during my initial coding days. Consider the following code.
//development define("HOST", "localhost"); define("DATABASE_USER", "root")...January 3, 2011
A web developers rants for new year

Image Courtesy: Desizn Tech
2011 has begun and everyone on the web is either busy in making predictions for the web or taking resolutions for another year. This post reflects on plans that I have for this year. Personally, I don't believe in resolutions that much. Adding to this fact that I am extremely lazy. So, absolutely no f****g guarentee for any of these to be complete. But it is always good to know where you are heading to. Here is what I plan to learn/achieve this...
Searching text in a HTML table using jQuery

Here is the situation. You have a really long table with hundreds of rows and you want to filter the rows(instantly!) that contain a specific keyword in any of the table cells.
This article will show how this can be achieved with the help of jQuery.
The HTML
Create a table with some rows with multiple cells. Put a textbox above the table in which search term will be entered.
Enter keyword to searchFacilities
January 2, 2011
Favorite tech links of the week : 27 Dec 2010 – 02 Jan 2011

This post contains some of the useful and interesting tech links I found during this week. To keep up to date with the latest information, subscribe to the feed or follow me on twitter @v08i
How to Create a jQuery Confirm Dialog Replacement – http://goo.gl/IwXQt35 Inspiring Examples of Websites Using HTML5 – http://goo.gl/pOjxYDebugging JavaScript Behind the Scenes – http://goo.gl/mTd4hMultiple virtual hosts in WAMP – http://goo.gl/hg59ageoPlugin – http://goo.gl/iviYzCon...December 29, 2010
Why you MUST use client side validation

Client side validation is checking the values against the desired format before sending them to server side for further processing. Javascript is used for validations on browser. Lately, with the popularity of jQuery, a large number of validation plugins are available which make it even more easy to implement validations on forms.
A word of caution before beginning. Though client side validation is very useful and simple to implement, it should NEVER be thought of as a...