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...
 •  0 comments  •  flag
Share on Twitter
Published on January 13, 2011 00:01

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 ...
 •  0 comments  •  flag
Share on Twitter
Published on January 11, 2011 22:27

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...

 •  0 comments  •  flag
Share on Twitter
Published on January 11, 2011 10:49

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 ...
 •  0 comments  •  flag
Share on Twitter
Published on January 11, 2011 00:22

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/DNTvy

32JavascriptAlternatives

10 Google Chrome Extensions for a Faster Browser – http://goo.gl/slpTR

Chrome Extensions

75+ Tools for Visualizing your Data, CSS, Flash, jQuery, PHP – http://goo.gl/K8771

75 Tools

Getting Started with HTML Emails – http://goo.gl/kej2h

HTML Emails

15 Easy G...
 •  0 comments  •  flag
Share on Twitter
Published on January 09, 2011 22:47

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 way

I 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")...
 •  0 comments  •  flag
Share on Twitter
Published on January 07, 2011 07:09

January 3, 2011

A web developers rants for new year






2011Image 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...

 •  0 comments  •  flag
Share on Twitter
Published on January 03, 2011 23:31

Searching text in a HTML table using jQuery






Filter Table

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.

View Demo

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 search

Facilities
 •  0 comments  •  flag
Share on Twitter
Published on January 03, 2011 04:31

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/IwXQt

jQuery-Confirm

35 Inspiring Examples of Websites Using HTML5 – http://goo.gl/pOjxY

html5

Debugging JavaScript Behind the Scenes – http://goo.gl/mTd4h

jsDebug

Multiple virtual hosts in WAMP – http://goo.gl/hg59a

wampserver

geoPlugin – http://goo.gl/iviYz

geoPlugin

Con...
 •  0 comments  •  flag
Share on Twitter
Published on January 02, 2011 18:16

December 29, 2010

Why you MUST use client side validation






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...

 •  0 comments  •  flag
Share on Twitter
Published on December 29, 2010 22:03