Saturday, May 23, 2009

Make Money Online - Online Home Based Job




Hi ,

I have something interesting for you, RupeeMail!

It’s really amazing! You get paid to open & read the contents of RupeeMail. You receive promotional offers & special discounts in RupeeMail.

Interestingly RupeeMails will reach you based on the preference list you opted for.

Create your RupeeMail Account & refer your friends to earn launch referral bonus on every new registration.

Try this... Join Now!

RupeeMail, It pays



Monday, April 27, 2009

Introduction to PHP

In this section you are going to learn a powerful server side scripting language is called PHP (Hypertext Preprocessor).

Pre knowledge required:

* HTML
* Basic scripting knowledge

About PHP

* PHP represents Hypertext Preprocessor
* PHP is a server-side scripting language, like ASP
* PHP scripts are executed on the server
* PHP supports many databases like: MySQL, Oracle, Sybase, Informix, PostgreSQL, Solid, Generic ODBC etc.
* PHP is an open source software
* PHP is free to download and configure.

Merits of PHP

* PHP runs on different platforms like: Windows, Linux, Unix, etc.
* PHP is compatible with almost all servers like: Apache, IIS, etc.
* PHP is free to download from the its official resource: www.php.net
* PHP is easy to understand and execute efficiently on the server side.

PHP File

* PHP files contain text, HTML tags and scripts
* It returned to the browser as plain HTML
* It has a file extension of ".php", ".php3", or ".phtml"

Requirement for PHP

If your server does not support to PHP, you must have to install PHP. Here is a link to learn how to install PHP: http://www.php.net/manual/en/install.php

If your server supports to PHP you have not required to do anything, you just create .php files in your web directory and run it on browser then the server will parse your php file. Because it is free, most web hosts offer PHP support.

Download PHP: Free Download PHP: http://www.php.net/downloads.php

Download MySQL Database: Free Download MySQL: http://www.mysql.com/downloads/index.html

Download Apache Server: Free Download Apache: http://httpd.apache.org/download.cgi

Thursday, January 22, 2009

What is differenc between mysql_connect and mysql_pconnect?

mysql_connect() and mysql_pconnect() both are working for database connection, but some different are as follows:

  • When we are using mysql_connect() function, every time it is opening and closing the database connection, depending on the request, But in case of mysql_pconnect() function, First, when connecting, the function would try to find a (persistent) connection that’s already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection. Second, the connection to the SQL server will not be closed when the execution of the script ends. Instead, the connection will remain open for future use (mysql_close() will not close connection established by mysql_pconnect()).
  • mysql_pconncet() is useful when you have a lot of traffic on your site. At that time for every request it will not open a connection but will take it from the pool. This will increase the efficiency of your site. In general use mysql_connect() is best. In mysql_pconnect(), ‘p’ stands for persistence connection.


What is the difference between echo and print statement?

  • echo() can take multiple expressions, print cannot
    take multiple expressions.

  • echo has the slight performance advantage because
    it doesn't have a return value. So, echo is a little bit faster but print
    return a integer value of 1.


  • <?php

    if(print('something'))

    // makes sense, while

    if(echo('something'))

    // doesn’t

    ?>

    PHP Interview Question?

    1. How I will check that user is logged in or not?
    2. I want to make it a function and I want to use it in each page and after login I want to go in current page?
    3. How do we know browser properties?
    4. If you have to work with dates in the following format: “Tuesday, February 14, 2006 @ 10:39 am”, how can you convert them to another format, that is easier to use?
    5. What is difference between require_once(), require(), include()?

    Tuesday, January 20, 2009

    PHP Interview Question

    1. How can I maintain the count of how many persons have hit my site?

    • Create a text file to store the no of value of user hit.
    • At the first time the file count variable is 0 then every time when the form is load and user click on that form at that time we open the file and increment the counter variable.
    • Then close the file in this way we can find that how many time the the page is hitted by the user
    • The best way is to use session variables. So that whenever a user hits web-page, we can increment the counter in the session variable set for number of users.
    • In your database maintain separate table visitor detail, for example you have user_detail table filed is count_user in your index file put on the particular code: mysql_query("update user_detail set count _visitor+1"); Whenever index file opened so that query will execute


    1. What is difference between mysql_fetch_array(), mysql_fetch_row() and mysql_fetch_object()?
    • mysql_fetch_array():- Fetch a result row as an associative array, a numeric array, or both by default it fetches both.

    • mysql_fetch_row() :- Get a result row as an numeric array.

    • mysql_fetch_object :- Fetch a result row as an object.


    1. How I can make a chat page in php in simple
    • Create a .txt file.
    • Open it in write mode then write something in message box that will write in that file.
    • Another user also open that file and write the file with the message box.
    • Also open the file in read mod in side window to see what the other user is written.
    • By this way we can make simple chat file with php.


    1. How I can get IP address of the usr?