Wednesday, November 13, 2013

How to Make an Image Downloadable


Create the HTML file to add a link like 'click here to download image'.
code:
<a href="download.php?imgfile=occ.png"><img src="download.png" alt="download image"></a>

Then create the download.php file.Code is given below
<?php
// Force download of image file specified in URL query string and which is in the same directory as this script:
if(!empty($_GET['imgfile']))
{
   $filename = basename($_GET['imgfile']); // don't accept other directories
   $size = @getimagesize($filename);
   $fp = @fopen($filename, "rb");
   if ($size && $fp)
   {
      header("Content-type: {$size['mime']}");
      header("Content-Length: " . filesize($filename));
      header("Content-Disposition: attachment; filename=$filename");
      header('Content-Transfer-Encoding: binary');
      header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
      fpassthru($fp);
      exit;
   }
}
header("HTTP/1.0 404 Not Found");
?>

Monday, October 28, 2013

4 Reasons Why You Should Pick Apple iOS over Android

It’s one of the most contentious questions among smartphone and tablet users: Android or iOS? Everyone seems to have an opinion as to what operating system is the best – or more accurately, what operating system is the worst. 


Recently, I wrote an article about making the switchiOS to Android. But Android devices aren’t right for everyone. There’s a reason why the Apple iPhone is the most popular smartphone in the country right now. And it’s not just good marketing and hype. Are you an Apple person? Itdepends on how important the following four factors are to you. Safety Android is the Wild West of phone operating systems. Stock devices largely come unprotectedattack. Sure, Google checks apps and viruses for malware on the Google Play store, but threats can comeanywhere – even via unsecured Wi-Fi locations. The phones are so vulnerable, in fact, that 32.8 million Android devices were infected with malware last year alone. If Android is the Wild West, Apple’s iOS is moreDisneyland. It’s a tightly controlled experience.apps created for the iPhone or iPad need to go through a rigorous testing process. Sure, the occasional bad seed slips through every now and then, but for the most part, the App Store is a clean, virus-free marketplace. Ease of Use My mother loves technology, but even she’d admit that she’s fara tech expert. So, when she asked my professional advice as to what kind of smartphone she should get, the answer was simple: Get an iPhone. Done. The fact of the matter is that Apple phones are incredibly easy to use. I didn’t need to sit down with my mother to explain how it worked – she was able to figure things out on her own simply by playing with it. Key features are easy to find. To borrow a phrase from Apple’s PR department, “it just works.” Design If you haven’t seen Apple’s iOS 7, you’re really missing out. Under the watchful eye of British designer Jony Ive, the new mobile

Friday, August 23, 2013

Export and Import SQL using Command Line ( C M D)

Sometimes when you have large databases, phpmyadmin or similar tool might fall when it comes to exporting or importing.
The easiest (and fastest) way is to use command line.

To export use this command:
mysqldump -u USER -p PASSWORD DATABASE > filename.sql

To import database from dump file (in this case called filename.sql) use:
mysql -u username -p password database_name < filename.sql

If you are on Windows you will need to open CMD and go to directory where mysql.exe is installed. If you are using WAMP server then this is usually located in:
C:\wamp\bin\mysql\mysql5.1.36\bin (*note the version of mysql might be different)

So you will:
cd C:\wamp\bin\mysql\mysql5.1.36\bin

and then execute one of the above commands.

Tuesday, February 12, 2013

Charge your phone with coffee and beer

 

A new device that can charge your mobile phone with a hot cup of coffee or a cold beer mug has been developed by a US company. 

The company claims that the two-sided Epiphany onE Puck converts the warmth of your hot cocoa or iced beverage into power for your phone. The lightweight device is portable enough to store in your purse or day bag for emergencies. 

The device uses a Stirling engine powered solely by heat disparities to generate the electricity to keep your phone up and running, Gizmag reported. 

Stirling engines were actually invented in 1816 as a rival to the steam engine, but its use was limited to low-power applications for a long time. 

Epiphany Labs is using modern materials to use the technology in a rather different way. The most obvious evolution comes in terms of size. 

The working prototype of the Epiphany onE Puck is not much larger than the bottom of a cup, so it's small enough to carry around easily. 

The device has two sides - a blue side for cold drinks and a red side for hot drinks. According to its creators, a hot drink is the optimal way to charge a device. 

It comes with a USB port that can charge any device that draws 1000mA or less. This means it can charge iPhones, Androids, iPods and other USB-based devices. 

Epiphany Labs claims that, in ideal circumstances, the device would be able to charge your phone at the same speed you would see plugging it in directly to a wall. 

It will also work in less-than-ideal conditions, but if you are not placing a fresh hot drink on the Puck, you will have to wait a little longer for your device to receive a full charge. 

The team from Epiphany Labs has a working prototype, and is turning to Kickstarter to get the funding needed for production.

 

Monday, October 29, 2012

Nokia out of 5 in global market

Finnish mobile handset manufacturer Nokia, which is facing a major crisis in global sales, still tops the list of mobile handset market in India even as it has been displaced from the fifth spot in global sales by the beleaguered BlackBerry maker  Research in Motion (RIM).

According to a report by Cybermedia, Nokia had 22.2 per cent share of the Indian handset market in terms of total unit shipments in the first half of 2012, followed by Samsung with 13 per cent and Micromax in the third spot with 5.5 per cent share.

India's total mobile handset shipments topped 102.43 million units, of which 5.50 million were smartphones, as per the report. Samsung topped the list of smartphone shipments, followed by Nokia and RIM.

The report also revealed that Android (with 56.4% market share) was the leading operating system (OS) in India, followed by Symbian (17.4% share), BlackBerry (12.1% share), Bada (8.5% share), iOS (3.0% share) and Windows Mobile (2.6% share) on a base of 5.50 million units, during the same period.

India is one of the few markets where Nokia still has a hold. As per an IDC report, the Finnish company has now dropped off the Top 5 list of smartphone vendors, which is led by Samsung and Apple at number 1 and 2 positions. Nokia was replaced by RIM at fifth position whose shipment volumes appear to have flattened though the company posted the second-highest year-over-year decline among any the leading vendors.

According to Kevin Restivo, senior research analyst with IDC's Worldwide Quarterly Mobile Phone Tracker, Nokia's share losses and the company's transition away from Symbian to Windows Phone has left ample opportunity for rivals to steal share away from Nokia over the past 18 months. 

Friday, October 5, 2012

Steve Jobs wanted to scrap Google Search from iPhones

Apple has been panned across the world for its new Maps application, which has been riddled with errors. Company CEO Tim Cook recently issued a public apology over the Maps fiasco and even went to recommend rivals map applications like Google and Nokia's to users of devices running on iOS 6. 

However, reportedly it was Steve Jobs' displeasure with Google over Android mobile OS which made Apple build its in-house Map app. Not just this, Jobs even wanted to scrap Google Search from all iOS devices. 

According to a report in Bloomberg Business Week, Jobs wanted to pull the plug on Google Search as well, but decided against it as users would not take that move lightly, considering Google's strength in the search department. 

The report says that Jobs, who envisioned the iPhone and the iPad, wanted to replace Google Maps as the mapping app for iDevices due to his hatred for the search giant. As per the report in Bloomberg Business Week, "Apple insiders say Jobs himself initiated the mapping project, putting mobile software chief Forstall in charge. He installed a secret team on the third floor of Building 2 on Apple's campus to replace Google Maps on the iPhone." 

Steve Jobs' hatred for Google was over certain features that it was not releasing for Apple devices. The report said, "At the time of his death, Jobs had come to loathe Google, which he felt was copying features of the iPhone while withholding a key feature of Google Maps that allows smartphones to dictate turn-by-turn directions aloud."

Windows 8 needs improvement: Microsoft co-founder


Describing elements of  Windows 8 as 'puzzling',  Microsoft co-founder Paul Allenhas admitted that the upcoming operating system needs some improvement. 

Allen said some elements of the operating system 'can induce confusion', but added that he was 'excited and impressed' by the new programme overall. 

"Windows 8 does certainly require a brief adjustment period before users become familiar and comfortable with the new 'bimodal' operating system," the Telegraph quoted Allen, as saying. 

Allen said he had been using Windows 8 on both a desktop computer and on a tablet, but described the dual operating system as confusing and said it was difficult to know which mode to choose when opening an application or a file. 

"A few minor issues aside, I'm impressed with its clever integration of a bimodal interface to simultaneously support both desktop and tablet use in the same operating system," he added. (ANI) 

iPhone 4 and 4S to get a price cut in India


Reports from various news sources claim that the iPhone 4 and 4S will soon get a price cut in India. The 16GB iPhone 4S is expected to see a price cut of Rs 3,100 to Rs 41,400. The iPhone 3GS, which last saw a price cut to Rs 9,999 via Aircel, has been discontinued.

The 8 GB iPhone 4, now the new entry-level iPhone, gets a price cut of Rs 9,100 to Rs 28,300. According to BGR.in, Apple will not be selling the iPhone 5 through Airtel or Aircel, and has appointed Ingram Micro and Redington for the launch of the iPhone 5 in India.

The phone is expected to launch in India by November. Meanwhile the iPhone 5 is already available online and in the grey market, at starting prices of Rs 60,000 for the 16 GB version and a drop dead rate of Rs 1,05,000 for the 64 GB variant.

The phone uses a nano-SIM, an even more slimmer version of the SIM card than its predecessor, which will have to be sourced from the carrier.

Three Apple resellers in Bangalore gave no confirmation on the availability of stocks and the new prices of the iPhone 4 or 4S.

1 billion-user mark


Facebook CEO Mark Zuckerbergtoday announced on the website that the world's biggest social network now has over 1 billion users. In an associated fact sheet, the company said that it surpassed the 1 billion-user mark on September 14, at 12.45 pm (Pacific Time).

The company stated that the median age of users joining the week that Facebook hit the 1 billion-mark was 22 years. Facebook's five biggest markets are Brazil, India, Indonesia, Mexico and the United States, as per the company fact sheet. It also said that it has 600 million users logging into the website from their mobile devices. Since February 2009, Facebook has witnessed 1.13 trillion users' likes, 219 billion photos being uploaded and 17 billion location-tagged pictures.
The world's biggest social network, Facebook hit the 500 million user mark in July 2010. At the end of June 2012, it had 955 million active members.

The Menlo Park, California-based company has had a difficult time of late. There were trading glitches the day it went public in May and concerns since then about its revenue potential. It's also facing lawsuits from disgruntled shareholders. CEO Mark Zuckerberg recently said that the company is going through a bit of a rough patch following its rocky initial public offering.

Saturday, August 18, 2012

image leaked : Samsung Galaxy Note II











A leaked image of the front panel of the upcoming Samsung Galaxy Note II has surfaced online. The image, provided to GSMArena.com by an anonymous tipster, shows that the design theme of the upcoming phablet (phone+tablet) is quite similar to that of the Samsung Galaxy S III.

The look is characterised by curved edges and a standard single hardware button flanked by a haptic key on either side. The Galaxy Note II is expected to be launched within the next few weeks, most likely during the SamsungUnpacked event on August 29, 2012.

In its post, GSMarena itself said that the authenticity of the image could not be verified by the tipster either, which casts some shadows over its credibility. However, rumours say that the design of the second generation Galaxy Note will be heavily inspired by Galaxy S III, thus gaining some credence to the image.

The post said that the tipster also provided data about the specifications of the yet-to-be-launched Note II. In line with speculations, these include a 5.5-inch SuperAMOLED touchscreen with regular RGB matrix. The tipster also informed GSMArena that the device was subjected for Full HD videos, but that put pressure on the battery of the device, and is likely to be shelved.

Another speculation reinforced by the post was the inclusion of a 1.5GHz Exynos 4 quad-core processor and 8MP rear camera. Samsung Galaxy Note is likely to be launched with Android 4.0 (Ice Cream Sandwich), since the Jelly Bean update for the same is still under development, the post stated

http://www.techgig.com/

Friday, August 10, 2012

India ranked second


India ranked second in the number ofeducation queries on Google, the search engine major said today.

India was ranked 8th in 2008, and is now behind only to the US, reveals a study titled 'Students on the web' compiled by Google India.

The study was compiled by combining Google search query patterns and an offline research conducted by TNS Australia on behalf of Google India.

Over 60 percent Indian students, who have access to Internet, use it as their first source to research for information related to educational courses and institutes, the study reveals.

"With over 60 million Internet user population in India being in age group of 18-35, educational related search queries are exploding on Google. Our core objective behind compiling this study was to understand the impact Internet is having on this young population with regard to education related decision making by the students,"Google India Vice President and Managing Director Rajan Anandan said.

Education related queries on Google in India are growing at over 46 percent year on year, that highlights strong demand for information on institutes and courses that are available in the country.

Out of all education related search queries on Google, over 40 percent of queries were for higher educationcourses and institutes.

Search queries from mobile phones have considerably grown showing a growth of over 135 percent and amounting to over 22 percent of all education related search queries.

Wednesday, August 8, 2012

TimesJobs.com has launched a career services portal


Times Business Soultions run online job portal TimesJobs.com has launched a career services portal namedStepAhead. According to the company, StepAhead is a one-stop destination offering a host of services customized for senior, mid and entry levels professionals. StepAhead’s portfolio of premium services range from providing expert advice and analysis of users Resume's strengths and tips on 'how to' make it better with Resume Critique.
StepAhead also provides Resume Distribution and Job Search Management services to make sure that the usres’profile reach top recruiters. With StepAhead’s Profile Verification Service, users can get profile’s credentials, both academic qualifications and employment histories verified, and win recruiters’ trust to get more interview calls.
StepAhead also offers Career Astrology with analysis and predictions in the areas of Work Place Compatibility, Career Growth, Personal SWOT Analysis, Get an Answer, Name Change, Job Shift Planner and Auspicious Dates.
“Undoubtedly, every working professional shares this dream of ‘Career Growth’. But this ambition has many definitions and manifests differently for each individual. While for some the goal would be Financial Freedom, or Bigger Status, for others it could be Recognition from the boss, colleagues, family and friends or even Society. StepAhead provides the bridge between this aspiration and its achievement,” summarized Mandeep Sodhi, Business Head, StepAhead.

Monday, August 6, 2012

PNB facilitates balance enquiry via missed call


“Missed Call” the uniquely Indian innovation has found new legitimacy of sorts at Punjab National Bank. Given how a large number of Indians like to give missed calls so as to indicate to the party at the other end to call back, the bank has devised a simple mechanism which exploits the trait in a unique manner.
The public sector lender has launched a service which allows its customers to find out their savings account balance by giving the bank a “missed call”.
All the customers have to do in order to know their savings account balance is dial the bank’s customer care at either 18001802222 or 01202490000 and give no more than three rings using their registered mobile phone numbers. Immediately after receiving the missed call, the system at the bank’s end sends the details of the accounts balance via an SMS.
The facility is an extension of the bank’s recently launched SMS-based alert service which has received an extremely favorable response from the customers, says the bank.
While PNB is perhaps the first bank in the country to exploit the missed call phenomenon, there have a few examples albeit outside the realm of banking and financial services sector, which indicate that the missed call culture may soon go mainstream in the enterprise.
Sangeetha Mobiles, a retailer with one of the country’s largest chain of mobile stores for instance uses a customized solution which enables prospective customers to get in touch with the mobile retailer via missed calls. Also, there have been reports of mobile application developers working on apps which can incorporate missed calls as a standard type of messaging like a text or even a regular call.

Mobile call rates likely to go up by 30p/min


Disappointed with Cabinet decision on fixing minimum or base price at Rs 14,000 crore for spectrum, the telecom industry today said the recommendations will prove to be "regressive" for the sector's growth and that operators would be forced to raise tariffs for consumers.
GSM operators body COAI, which countsBharti Airtel, Vodafone and Idea Cellularamong its members, said the move will impact tariffs by 30 paise per minute on an average.
"It will continue to have an impact on the tariffs to the extent of about 30 paisa per minute. The effect on finances is that an amount of Rs 3,20,000 crore of additional debt that will have to be laid on the industry," COAI said.
Also, the banking industry itself has said that it would be near impossible to continue to fund this type of a demand for investment funds, he added.
"So the only thing that this is going to balance is perhaps the budget of the country if at all even that. So we really don't see any benefit that this decision does to the industry," Mathews said.
CDMA operators body AUSPI agreed. "It (reserve price) is still very high. It will definitely affect the tariffs," Association Of Unified Telecom Providers Of India Secretary General SC Khanna said.
KPMG Executive Director Jaideep Ghosh also said the pricing is on the higher side and that tariffs for consumers, which have gone up recently, would continue to "firm up".
The Cabinet, headed by Prime Minister Manmohan Singh, has decided to fix the reserve price at Rs 14,000 crore for 5 Mhz of airwaves as against around Rs 18,000 crore recommended by sectoral regulator Trai for spectrum auction.
The Supreme Court had, in February this year, cancelled 122 licences issued by the then Telecom Minister A Raja in 2008 and asked the government to conduct fresh auctions by August 31.
But this deadline may not be met and the government may approach the apex court for extension of the timeline

Saturday, August 4, 2012

Indian IT companies Wipro, Infosys to tweak hiring strategy

India's IT companies, which hired approximately 1.5 lakh students from campuses last year, will be hiring much less during this placement season starting August-September. 

Country's third-largest software exporter Wipro, which had planned to keep the ratio of on-campus and off-campus hiring at 90:10 in the beginning of the year, has now changed it to 70:30, a senior executive from the Bangalore-based company said. "We will hire in a measured way till we get more (demand) visibility and increase off-campus numbers," the executive added. 

In campus hires, companies have to make offers and wait for at least six months till the student finishes his degree. But it can hire off-campus as and when there is demand for more hands. Off-campus recruitments include freshers who had opted out of placements and some with very little work-experience and are picked by companies through hiring drives and job fairs. 

"Off-campus hiring is gaining traction, especially among large IT firms that are cautious and are not able to take long-term business decisions," says Nasscom President Som Mittal said. "It helps them to take hiring decisions based on their needs." 

Nasscom has cut IT-BPO industry's growth forecast to 11-14% this year, down from 16% last year. Some companies like Infosys have given a revised projection of 5%. IT companies are looking to calibrate hiring to the slowdown. 

Last month, country's second-largest IT exporter Infosys said it could delay the joining dates of over 25,000 freshers it had hired from campuses in the 2011 placement season. Its mid-tier rival iGate, too, has delayed joining dates of close to 1,000 fresh engineers by a month or two. 

TCS, India's largest IT firm which will hire 50,000 people this year, plans to maintain its campus hiring. 

Companies say that quality is not an issue in off-campus hiring - despite many of the applicants being rejects from previous placement processes - if one is prepared to search harder for the right hires. "If 3 out of 10 people are suitable on-campus, that ratio will be much lower off-campus. You have to drudge a lot more to get the right people," says Naveen Narayanan, Global Head -Talent Acquisition, HCL Technologies

HCL is willing to take the extra effort and will maintain its 70:30 ratio of on-campus to off-campus this year. It makes economic sense to spread hiring across all months, instead doing the bulk during placement season. 

Mid-tier firms are following suit, but to break the monopoly enjoyed by the IT mammoths during placements. "Off-campus increases our chance of finding the right talent," Parthasarathy NS, COO of MindTree, said. "Large companies often visit campuses and recruit 95% of the best students on day one. Smaller firms, which typically visit on day 3 and 4, are left with a very small number," he added. 

MindTree has therefore decided to increase its off-campus quota from 10% of total hires to 30% this year. This strategy is expected to give the Bangalore-based firm wider reach in tier-III and -IV colleges. 

"Given the uncertain economic scenario, I would assume that on-campus placement numbers are going to come down this year," says Bhaskar Chavli, Chief Delivery Officer at NIIT Technologies. "Companies may want to see how business turns out and then decide on hiring targets." 

Gurgoan-based start-up CoCubes.com - it connects companies and colleges through an online recruitment platform - has seen on-campus hiring over the past one year drop by 30-40%. The start-up, which works with companies like Capgemini and UST Global, had experienced a rush for off-campus demand in 2010. Back then Accenture placed urgent orders for 1,500 freshers off-campus in eight weeks and feels sudden demand will come their way again. 

"A similar trend seems to be coming back this year as more companies wait for the economic environment to stabilise and then finalise their hiring plans," says Harpreet Singh Grover, co-founder and CEO of CoCubes.com. 


Read More :http://www.techgig.com/tech-news/editors-pick/Indian-IT-companies-Wipro-Infosys-to-tweak-hiring-strategy-14138
courtesy : http://www.techgig.com

LEFT TO RIGHT MULTIPLE SELECT BOX AN EASY WAY

Here is the javascript to select multiple options from left multiple to right multiple selection box


//////////////////////////////////// SAMPLE HTML /////////////////////////////////////


<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<div style="font-size:12px;color:#999999">Applicable Courses </div>
</td>
<td><div style="font-size:12px;color:#999999"></div> </td>
<td><div style="font-size:12px;color:#999999">Selected Courses </div> </td>
</tr>
   <tr >
    <td>

    <select name="left-select" id="left-select" size="5" multiple="multiple" style="width:150px; font-size:12px;color:#999999;">
    <?php
if($action!='Edit'){

foreach($result_course_reservations as $key=>$data){
$course=$data['chrCourseCode'];
?>
    <option value="<?php echo  $data['intAutoNo']; ?>"<?php if($intCourseReservID==$data['intAutoNo']){ echo "selected"; } ?>><?php echo $course; ?></option>
    <?php }
}else{
foreach($result_course_reservation as $key=>$data){
$course=$data['chrCourseCode'];
?>
   <option value="<?php echo  $data['intAutoNo']; ?>"<?php if($intCourseReservID==$data['intAutoNo']){ echo "selected"; } ?>><?php echo $course; ?></option>
    <?php }
} ?>


    </select>

    </td>
    <td style="padding-right:20px;text-align:center">
    <a onclick="sendSelectedOptions();" onmouseout="selectAll('right-select',true)" style="cursor:pointer;" title="Add"> <strong>>></strong> </a>
    <br/>
    <a onclick="removeSelectedOptions();" style="cursor:pointer;" title="Remove All"> <strong><<</strong> </a>
<br />
 <a onclick="selectAll('right-select',true)" style="cursor:pointer; font-size:13px"> <strong>Confirm</strong> </a>
    </td>
    <td>
    <select name="right-select[]" id="right-select" size="5" multiple="multiple"  style="width:150px; font-size:12px;color:#999999;"></select>
    </td>
  </tr>
</table>



////////////////////MULTIPLE SELECTION BOX :JQUERY  SCRIPT ////////////////////////////////////

function sendSelectedOptions(){
    $("select#left-select option:selected").each(function () {
               var o1 = new Option($(this).text(),$(this).val());
  var position = $(this).attr("rel");
               o1.setAttribute("rel",position);
               $("select#right-select").append(o1);
    });

    $("select#left-select option:selected").remove();

    sortDropDownListByText('right-select');

}

function removeSelectedOptions(){
    $("select#right-select option:selected").each(function () {
               var o1 = new Option($(this).text(),$(this).text());
               var position = $(this).attr("rel");
               o1.setAttribute("rel",position);

               $("select#left-select").append(o1);
    });

    $("select#right-select option:selected").remove();
    sortDropDownListByText('left-select');

}

function sortDropDownListByText(selectID) {
    // Loop for each select element on the page.
    $("select#"+selectID).each(function() {

        // Keep track of the selected option.
        var selectedValue = $(this).val();

        // Sort all the options by text. I could easily sort these by val.
        $(this).html($("option", $(this)).sort(function(a, b) {
            return a.text == b.text ? 0 : a.text < b.text ? -1 : 1
        }));

        // Select one option.
        $(this).val(selectedValue);
    });
}




function selectAll(selectBox,selectAll) {
    // have we been passed an ID

    if (typeof selectBox == "string") {
        selectBox = document.getElementById(selectBox);
    }

    // is the select box a multiple select box?
    if (selectBox.type == "select-multiple") {
        for (var i = 0; i < selectBox.options.length; i++) {
            selectBox.options[i].selected = selectAll;
        }
    }
}




Friday, August 3, 2012

PHP- Upload and convert avi, wmv, mov and mpg videos to FLV


PHP- Upload and convert avi, wmv, mov and mpg videos to FLV

Upload and convert avi, wmv, mov and mpg videos to FLV using PHP
1.First you have to create a page from where the user will upload a videolets
call it uploadvideo.php.

follow the code below..

<form name=”frm” action=”uploadvideopro.php” method
=”post” enctype="multipart/form-data" >

<input name="x_URL" type="file" class="form1"
size="26">

<input type="submit" name="submit" value="upload"
>

</form>



2.Secondly on the process page i.e. uploadvideopro.php . follow the following
code..



/***************Load FFMPEG *********************************/



$extension = "ffmpeg";

$extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;

$extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;





// load extension

if (!extension_loaded($extension)) {

dl($extension_soname) or die("Can't load extension $extension_fullname\n");

}



/***********************************************************/



/*****************Get the path to Extention ****************/



$array_path = explode("/",$_SERVER['SCRIPT_FILENAME']);

$dynamic_path = "";

for ($i=0;$i<sizeof($array_path)-1;$i++)

if($array_path[$i]!="")

$dynamic_path =$dynamic_path."/".$array_path[$i];

/**********************************************************/



/******************set folders*****************************/

$flvpath = "flvfiles/";

$moviepath = "movies/" ;

chmod($moviepath,0777);

chmod($flvpath,0777);

/*********************************************************/


/******************Upload and convert video *****************************/



if(isset($_FILES["x_URL"]))

{

$fileName = $_FILES["x_URL"]["name"];

$fileNameParts = explode( ".", $fileName );

$fileExtension = end( $fileNameParts );

$fileExtension = strtolower( $fileExtension );

if($fileExtension=="avi" || $fileExtension=="wmv" || $fileExtension=="mpeg"
|| $fileExtension=="mpg" || $fileExtension=="mov" )

{

if ( move_uploaded_file($_FILES["x_URL"]["tmp_name"],$ moviepath.$_FILES["x_URL"]["name"])
)

{



if( $fileExtension == "wmv" ) {

exec("ffmpeg -i ".$dynamic_path."/".$ moviepath."".$fileName."
-sameq -acodec mp3 -ar 22050 -ab 32 -f flv -s 320x240 ".$dynamic_path."/".$flvpath."myflv.flv");

}

if( $fileExtension == "avi" || $fileExtension=="mpg" ||
$fileExtension=="mpeg" || $fileExtension=="mov" ) {

exec("ffmpeg -i ".$dynamic_path."/".$ moviepath."".$fileName."
-sameq -acodec mp3 -ar 22050 -ab 32 -f flv -s 320x240 ".$dynamic_path."/".$flvpath."myflv.flv");

}

/******************create thumbnail***************/

exec("ffmpeg -y -i ".$dynamic_path."/".$moviepath."".$fileName."
-vframes 1 -ss 00:00:03 -an -vcodec png -f rawvideo -s 110x90 ".$dynamic_path."/".$flvpath."myflv.png");


}

else

{

die("The file was not uploaded");

}

}



else

{

die("Please upload file only with avi, wmv, mov or mpg extension!");

}

}

else

{

die("File not found");

}

Date Function Formatting


DAYS 
d - day of the month 2 digits (01-31)
j - day of the month (1-31)
D - 3 letter day (Mon - Sun)
l - full name of day (Monday - Sunday)
N - 1=Monday, 2=Tuesday, etc (1-7)
S - suffix for date (st, nd, rd)
w - 0=Sunday, 1=Monday (0-6)
z - day of the year (1=365)
WEEK
W - week of the year (1-52)
MONTH
F - Full name of month (January - December)
m - 2 digit month number (01-12)
n - month number (1-12)
M - 3 letter month (Jan - Dec)
t - Days in the month (28-31)
YEAR
L - leap year (0 no, 1 yes)
o - ISO-8601 year number (Ex. 1979, 2006)
Y - four digit year (Ex. 1979, 2006)
y - two digit year (Ex. 79, 06)
TIME
a - am or pm
A - AM or PM
B - Swatch Internet time (000 - 999)
g - 12 hour (1-12)
G - 24 hour c (0-23)
h - 2 digit 12 hour (01-12)
H - 2 digit 24 hour (00-23)
i - 2 digit minutes (00-59)
s 0 2 digit seconds (00-59)
OTHER e - timezone (Ex: GMT, CST)
I - daylight savings (1=yes, 0=no)
O - offset GMT (Ex: 0200)
Z - offset in seconds (-43200 - 43200)
r - full RFC 2822 formatted date

Give Month number Get month name in PHP


Here’s a quickie for you. 
Ever wanted to convert a month number to a month name in PHP but hated having to do a huge switch statement? Well here is your answer.

<?php
$monthNum = 5;
$monthName = date("F", mktime(0, 0, 0, $monthNum, 10));
echo $monthName; //output: May
?>
Enjoy.

Hackers may bring down India’s power grids :


Hackers may bring down India’s power grids













 It is possible for an adversary or a group of hackers to cripple India's power grids through a cyber-attack, although this is an unlikely reason for the recent power outages that crippled much of north, east and north-eastern India. 

Since the first power trip up on Monday, there have been discussions within the security establishment about the possibility of entities trying to carry out a sophisticated cyber-attack to cripple the grids. 

Officials who carried out an audit of critical information infrastructure admit it is "theoretically possible" to cripple India's power grids through a cyber-attack. 

Despite such a possibility, the shutdown did not seem to have led to a crisis management procedure that aimed at ruling out or confirming a cyber-attack. 

"Given the fact that our grids are vulnerable to a cyber-attack, those responsible for managing grids should have a proactive policy to rule out cyber-attack as part of their crisis management procedures," a senior official said. "But none of it was visible," he added. 

Sources aware of contacts among power ministry, power grid authorities and those in bothCERT-IN (Computer Emergency Response Team-India) and NTRO (National Technical Research Organisation) say there was no proactive effort by those responsible for power grids. 

However, both CERT-IN and NTRO are believed to have established their own procedures to ensure the shutdowns were not a cyber-attack, having been brought on by massive over-the-limit withdrawals by states to supply electricity for pumps tapping groundwater in the absence of rainfall during this monsoon. 

Officials said the government is now discussing possible ways to speed up the setting up of National Critical Information Infrastructure Protection Centre (NCIPC), which would act as the command and control centre for monitoring the critical information infrastructure of the country. NCIPC was recently approved by the National Security Council headed by the Prime Minister. 

Sources said the government is also planning to hold a national consultation of all stakeholders involved in critical information infrastructure. 

The government is already setting up dedicated CERT-INs for various critical sectors such as power and civil aviation. 

Officials point out to breaches reported from power grids in the US, cyber intrusion into the Iranian nuclear network and other such incidents around the world to warn that India needs to have a more robust crisis management procedure that includes proactive ruling out of cyber-attacks.


courtesy : techgig.com