Set - 9

Question 6 :

Please give a regular expression (preferably Perl/PREG style), which can be used to identify the URL from within a HTML link tag.

Answer :

Try this: /href="([^"]*)"/i


Question 7 :

How can I use the COM components in php?

Answer :

The COM class provides a framework to integrate (D)COM components into your PHP scripts.
string COM::COM( string module_name [, string server_name [, int codepage]]) - COM class constructor.

Parameters:

module_name: name or class-id of the requested component.
server_name: name of the DCOM server from which the component should be fetched. If NULL, localhost is assumed. To allow DCOM com, allow_dcom has to be set to TRUE in php.ini.
codepage - specifies the codepage that is used to convert php-strings to unicode-strings and vice versa. Possible values are CP_ACP, CP_MACCP, CP_OEMCP, CP_SYMBOL, CP_THREAD_ACP, CP_UTF7 and CP_UTF8.
Usage:

$word->Visible = 1; //open an empty document 
$word->Documents->Add(); //do some weird stuff 
$word->Selection->TypeText("This is a test…"); 
$word->Documents[1]->SaveAs("Useless test.doc"); //closing word 
$word->Quit(); //free the object 
$word->Release(); 
$word = null;

 


Question 8 :

How many ways we can give the output to a browser?

Answer :

HTML output
PHP, ASP, JSP, Servlet Function
Script Language output Function
Different Type of embedded Package to output to a browser


Question 9 :

What is the default session time in php and how can I change it?

Answer :

The default session time in php is until closing of browser


Question 10 :

What changes I have to do in php.ini file for file uploading? 

Answer :

Make the following line uncomment like:
; Whether to allow HTTP file uploads.
file_uploads = On
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = C:\apache2triad\temp
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M