Archive for October, 2008

PHP Interview Questions and Answers

Question: Is PHP a case sensitive programming language?
Answer: PHP is a partially case sensitive programming language. We can use function names, class names in case insensitive manner.
Question: What is mean by LAMP?
Answer: LAMP means combination of Linux, Apache, MySQL and PHP.
Question: How do you get the user’s ip address in PHP?
Answer: Using the server variable: [...]

Generating CAPTCHA Image Using PHP

The CAPTCHA concept is very useful to prevent automated registration. If you have enabled gd library, you can create a captcha code for your registration form using PHP.
Consider the following parts of code, name the file as “captcha.php”
session_start();
if(isset($_SESSION['captcha']))
{
unset($_SESSION['captcha']);
}

The above code will start session and clear the old captcha’s session value if it [...]

File Uploading in PHP

File uploading is very simple in PHP when comparing to other server side programming languages. File uploading is very useful in most of the situations like uploading user’s photos, uploading csv reports, uploading pdf reports and so on.
Making a simple front end with file browsing box:
<form enctype=”multipart/form-data” method=”post”>
Upload a file
<input name=”my_file” type=”file” />
<input type=”submit” value=”Upload” [...]