LAMPInterview

A Venture from AccuGlobal.com

Archive for May 7th, 2008

How do you capture audio or video in PHP?

Posted by lampinterview on May 7, 2008

FFMPEG or FFMPEG_PHP is used to record, convert and stream audio and video. It includes libavcodec, the leading audio or video code library. FFMPEG or FFMPEG_PHP is developed under Linux, but it can compiled under most operating systems, including Windows.

Posted in PHP | Tagged: , , , | No Comments »

Difference between COPY and MOVE_UPLOAD_FILE function in php?

Posted by lampinterview on May 7, 2008

Copy Makes a copy of a file. Returns TRUE if the copy succeeded otherwise return FALSE.

move_uploaded_file() function checks to ensure that the file designated by filename is a valid upload file. If the file is valid, it will be moved to the filename given by destination. If filename is not a valid upload file, then no action will occur, and move_uploaded_file() will return FALSE.

Posted in PHP | Tagged: , , , , | No Comments »

How do we know browser properties?

Posted by lampinterview on May 7, 2008

get_browser() is used to determine the browser properties. you can check browscap.ini file.

$browser = get_browser();
foreach ($browser as $name => $value) {
echo “<b>$name</b> $value <br />\n”;
}

Posted in PHP | Tagged: , , | No Comments »

What is CAPTCHA images?

Posted by lampinterview on May 7, 2008

CAPTCHA will generate an image containing string of numbers and letters. this is to prevent spammers. So many programmers can create curl script which attach your form and fill junk data and send mail to you. Using bots which can fill forms automatically. If you use captcha then bots will not identify the string or numbers. By entering the numbers and letters from the image in the validation field, the application can be assured that this is not spam.

Posted in PHP | Tagged: , , , , | No Comments »

How do you know whether the recipent of your mail had checked the mail or not?

Posted by lampinterview on May 7, 2008

Having the html email to execute a Javascript segment may be too much.  But embed an URL in a say 0-byte image tag may be the better way to go.  In other word, you embed a invisible image on your html email and when the src URL is being rendered by the server, you can track whether your recipients have view the emails or not.

Posted in PHP | Tagged: , , | No Comments »

What are magic quotes in PHP?

Posted by lampinterview on May 7, 2008

Some special characters in PHP like, single quote( ‘ ), double quote( ” ), amperson ( & ) etc. are escape by slash its called magic quotes. Its useful for beginner programmer.

Posted in PHP | Tagged: , , , | No Comments »

What is the use of obj_star?

Posted by lampinterview on May 7, 2008

Well, its initializing the object buffer, so that the whole page will be first parsed (instead of parsing in parts and thrown to browser gradually) and stored in output buffer so that after complete page is executed, it is thrown to the browser once at a time.

Posted in PHP | Tagged: , | No Comments »

How do you create subdomains using PHP?

Posted by lampinterview on May 7, 2008

–> Create the appropriate web root directory,
for example /home/sites/username/web, and any subdirectories   you wish
–> Edit httpd.conf -  add a new virtual host section
–> Restart httpd
In a normal Linux server setup, php/Apache does not have the necessary permissions to do all this.

Posted in Apache | Tagged: , | No Comments »

How do i limit the no of rows 1 get out of my database?

Posted by lampinterview on May 7, 2008

– LIMIT

eg: select * from ‘tablename’ where ‘condition’ LIMIT 1;

Posted in MYSQL | Tagged: , | No Comments »

How can i fetch only the unique values in mysql?

Posted by lampinterview on May 7, 2008

– through DISTINCT function.

eg: select DISTINCT ‘fieldname’ from ‘tablename’ where ‘condition’

Posted in MYSQL | Tagged: , , | No Comments »