google transliteration API easy to implement

http://code.google.com/apis/ajaxlanguage/documentation/multilangtransliteration.html

finding or replacing double quotes in PHP

To find double quotes in PHP write in following way in as you required string function I wrote an example to replace “” in blank space

echo str_replace(“\””,” “,”sujata”likhar “);

Its output will be

sujata likhar

you can you this for any other string function too

get proper indantation to display category and its sub categories…and so on

Here is code by which you can display categories and its category of any entity with proper indentation ….this is true for n number of subcategories ….this is made by using purely recursion ….it is really amazing try it this will give very perfect look to your website ….
you can see its working example at following link
Click me (example)
you can see it in whole website .
Here is the codding……..

function subcats($id,$pagen)
{
$result= mysql_query("select * from categories where parentcat=$id ");
if($id!=0)
echo ul

while($row1=mysql_fetch_array($result))
{
if($id==0)
$pagename=$row1['mainpage'];
else
$pagename=$pagen;

$spa=$row1['catlevel'];

if($id!=0)
echo li
if($id!=0)
echo /li;
subcats($row1[0],$pagename);
}
if($id!=0)
echo /ul

}

use this as follow
subcats(0,'');

you will see this will change view of your web pages completely.

If you feel this code is really helpful for you then please comment this .

send mail to group of people through ” Outlook”

Error:”invalid session” in Open invitre

where you are using open inviter to invite your friends for joining any community. and while sending message after importing contacts the error occures ….. “Invalid session ”

in such situation just open _base.php file and comment that section where cookie get check in short from where the code of this is error is written using echo just comment that condition.
Now you wont face this error and when you see the message “message sent”.

now enjoy this code and in case of any problem leave comment . I always ready to solve problems…..

UPLOAD CSV FILE INTO DATABASE IN PHP

To insert the data of a csv file directly into data base ,this code is perfectly working.

include("connect.php");
if(isset($_POST['submit']))
{
$filename=$_POST['filename'];
$handle = fopen("$filename", "r");
$isfirst=true;
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
{
if($isfirst)
{
$isfirst=false;
continue;
}
$import="INSERT into student(rollno,name,father,dob,address) values('$data[0]','$data[1]','$data[2]','$data[3]')";
mysql_query($import) or die(mysql_error());
}
fclose($handle);
print "Import done";
}

First make connect.php for database connection then copy past above code in the file where you required.Take care of change insert query as per required.In case of any problem leave post.

On running this page you will get the message “Import Done”

Simple PHP calendar

This is simple calendar coded in PHP. This is the simplest calendar I found.This is 2 files only purely made in PHP . On file is for calling clender generating function and another contain function for generating calendar by passing month and year .

calender.php


include("month.php");
//$month = date("n");
echo $cid;
if(isset($_GET['month']))
{
$month=$_GET['month'];
}
else
$month='12';

if(isset($_GET['year']))
{
$year=$_GET['year'];
}
else
$year = date("Y");

if($month==0)
{
$year=$year-1;
$month=12;
echo month($month,$year);
}
else if($month>12)
{
$month=1;
$year=$year+1;
echo month($month,$year);
}
else
{
echo month($month,$year);
}
<a href="npcal.php?nid=&month=&year=">Prev                        
<a href="npcal.php?nid=&month=&year=">Next

here one file is not show for that leave post with your email id i will send at your email address.

Enjoy codding……….

To add facility to invite friends from your contact ……”Openinviter”

For providing facility if you are making a web site related to social networking purpose this will help you really. for this there is very simple solution which is called as OpenInviter

this will provide you plugins of different most popular social networking websites. to use this just make account on www.openinviter.com .

next go to download option add download to “General usage pack. Download this if you want to integrate it in an environment that doesn’t have an especially designed package.”

next extracts the zip folder a read help file this will make you more comfortable. for using it.follow all the steps one by one.

as you follow all the steps then for testingĀ  run example.php.

And then see the results………..

It is very usefull………….