Tuesday, August 31, 2010

80's South Indian Film Stars

Hi Friends,

Here is the pic taken of the 80's South Indian Film Stars when they united in a special get together event held on Aug 29 (i.e. Sunday) night in Chennai. The event organised by Suhasini Maniratnam and hosted by Lissy Priyadarshan.

 All together the event was attended by around 29 actors and was called as Evergreen 80s. From the Telugu industry, Chiranjeevi, Venkatesh, Bhanuchandar, Naresh, Suresh, Ramya krishna and Suman were present. From the Tamil industry, the actors attended the event were superstar Rajnikanth, Sharat Kumar, Arjun, Mohan, Karthik, Prabhu, Suhasini, Radhika, Poornima, Radha, Kushbu, Ambika and Nadiya. From the Malayalam, Mohan Lal and Shobhan were present while from Kannada industry, Sumalatha and Ambarish attended the event.

This is nice to see all the south Indian film stars in a single pic.

Download the pic, here is the link for download, Click here


Saturday, August 28, 2010

Joomla - Most popular open source

Joomla, is the most popular open source software in PHP. It is free for publishing. It uses PHP for coding & MySQL for storage i.e. Database.

Want to learn Joomla, & publish the Site. Here is the free tutorial. Download Joomla Tutorial & have a fun learning.

For download, Click Here














 

Sunday, August 22, 2010

HTACCESS code to redirect to 404 page

htaccess in Linux server is used for rewriting the URL & also used for redirecting to a Pre-defined error page(404 error page) when there is no file or page in the site.

Here is the rule for redirecting to Error page(404 page -- i.e. Page Not found)

Ex;- ErrorDocument 404 http://www.yoursitename.com/error404.php

Ex:- ErrorDocument 404 http://www.yoursitename.com/error404.html

we can define any filename for redirecting, in the above example, I've given an error404.php or error404.html as examples

Friday, August 20, 2010

Function for taking MySQL Backup in PHP

Here is the function for taking backup of a MySQL database without any external tool for MySQL.

$host ---> Hostname
$user ----> Username
$pass ----> Password
$name ----> Database name
If we need the total database, just put the value of $tables as * or else pass only the tables you want with comma separated.

function backup_tables($host,$user,$pass,$name,$tables = '*')
{

 $link = mysql_connect($host,$user,$pass);
 mysql_select_db($name,$link);

 //get all of the tables
 if($tables == '*')
 {
 $tables = array();
 $result = mysql_query('SHOW TABLES');
 while($row = mysql_fetch_row($result))
 {
 $tables[] = $row[0];
 }
 }
 else
 {
 $tables = is_array($tables) ? $tables : explode(',',$tables);
 }

 //cycle through
 foreach($tables as $table)
 {
 $result = mysql_query('SELECT * FROM '.$table);
 $num_fields = mysql_num_fields($result);

 //$return.= 'DROP TABLE '.$table.';';
 $row2 = mysql_fetch_row(mysql_query('SHOW CREATE TABLE '.$table));
 $return.= "\n\n".$row2[1].";\n\n";

 for ($i = 0; $i < $num_fields; $i++)
 {
 while($row = mysql_fetch_row($result))
 {
 $return.= 'INSERT INTO '.$table.' VALUES(';
 for($j=0; $j<$num_fields; $j++)
 {
 $row[$j] = addslashes($row[$j]);
 $row[$j] = ereg_replace("\n","\\n",$row[$j]);
 if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; }
 if ($j<($num_fields-1)) { $return.= ','; }
 }
 $return.= ");\n";
 }
 }
 $return.="\n\n\n";
 }
$s_file = 'db-backup-'.time().'-'.'.sql';
 //save file
 $handle = fopen($s_file,'w+');
 fwrite($handle,$return);
 fclose($handle);
 header("Location:".$s_file);
 exit;
}