1. Question:What are the technical difference between echo() and print() function? 

    Answer
    The echo() function is a bit faster because it returns nothing, whereas print() will return 1 if the statement is successfully output.

    1. Report
  2. Question:What is datatype? 

    Answer
    A datatype is the generic name assigned to any data sharing a common set of characteristices.  Common data types include Boolean, integer, float, string, and array.

    1. Report
  3. Question:Define DNS. 

    Answer
    The Domain Name System (DNS) allows to use domain names (e.g. yahoo.com) in place of the corresponding IP address, such as 192.0.32.166.

    1. Report
  4. Question:What is domain name server? 

    Answer
    The domain names and their complementary IP addresses are stroed on domain name servers, which are interspersed across the globe.

    1. Report
  5. Question:What are the five  configuration directives that pertinent to PHP mail() function? 

    Answer
    1. SMTP=string, Scope:PHP_INI_ALL
    2. sendmail_from=stirng, Scope:PHP_INI_ALL
    3. sendmail_path=string, Scope:PHP_INI_SYSTEM
    4. smtp_port=integer, Scope:PHP_INI_ALL
    5. mail.force_extra_parameters=string, Scope:PHP_INI_SYSTEM

    1. Report
  6. Question:Explain the parameters of PHP’s mail function. 

    Answer

    The PHP mail() function is used to send emails from inside a script.

    Prototype:

    boolean mail(string to, string subject, string message [, string addl_headers [, string addl_params]])

    ParameterDescription
    toRequired. Specifies the receiver / receivers of the email
    subjectRequired. Specifies the subject of the email. Note: This parameter cannot contain any newline characters
    messageRequired. Defines the message to be sent. Each line should be separated with a LF (\n). Lines should not exceed 70 characters
    headersOptional. Specifies additional headers, like From, Cc, and Bcc. The additional headers should be separated with a CRLF (\r\n)
    parametersOptional. Specifies an additional parameter to the sendmail program


    Example:

    <?php
      
        mail("client@example.com","This is a subject","This is the mail body","from:admin@example.com\r\n");

    ?>

    1. Report
  7. Question:How does the session data store in computer? 

    Answer
    Session data can be stored in four ways: 
    1. Within flat failes (files),
    2. Within volatile memory (mm),
    3. Using the SQLite database (sqlite), or
    4. Through user-defined functions (user).

    1. Report
  8. Question:Name five internet services that commonly operates on a particular communications port. 

    Answer
    1. HTTP - Hyper Text Transfer Protocol
    2. FTP - File Transfer Protocol
    3. POP3 - Post Office Protocol
    4. IMAP - Internet Message Access Protocol
    5. SSH - Secure SHell

    1. Report
  9. Question:How do you retrive internet service port number in php? 

    Answer
    The getservbyname() function returns the port number of a specified service.

    Prototype:

    int getservbyname(string service, string protocol)

    Example:

    <?php
       echo "HTTP's default port number is: ".getservbyname("http","tcp");

    ?>

    1. Report
  10. Question:How do you get a socket connection in php? 

    Answer
    The fsocketopen() function establishes a connection to the resource designated by target on port.

    Prototype:

    resource fsockopen( string target, int port [, int erron [, string errsting [, float timeout]]])

    Example:

    <?php
       $http=fsockopen("www.example.com",80);
     
       $req="GET / HTTP/1.1\r\n";
       $req.="Host: www.example.com\r\n";
       $req.="Connection: Close\r\n\r\n";

      fputs($http,$req);
     
      while(!feof($http)){

          echo fgets($http,1024);

       }
    fclose($http);
     
    ?>

    1. Report
Copyright © 2024. Powered by Intellect Software Ltd