PHP Interview Questions Answers| PHP Tutorials | Technical Questions

Recent Question and Answers

Cross-site scripting (XSS) is a security exploit in which the attacker inserts malicious coding into an link that appears to be from a trustworthy source. When someone clicks on the link, the embedded programming is submitted as part of the client's Web request and can execute on the user's computer, typically allowing the attacker to steal information. Web forms that dynamically return an error message including user input data make it possible for attackers to alter the HTML that controls the behavior of the form and/or the page. Attackers....! Calculate the md5 hash of a string. The hash is a 32-character hexadecimal number. ....! ANS:XMLHttpRequest ....!
The syntex for repairing a mysql table is REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended] This command will repair the table specified if the quick is given the mysql will do a repair of only the index tree if the extended is given it will create index row by row ....! Memcache is a technology which caches objects in memory where your web application can get to them really fast. It is used by sites such as Digg.com, Facebook.com and NowPublic.com and is widely recognized as an essential ingredient in scaling any LAMP application to handle enormous traffic.   ....! Model-view-controller (MVC) is a design pattern used in software engineering. In complex computer applications that present lots of data to the user, one often wishes to separate data (model) and user interface (view) concerns, so that changes to the user interface do not impact the data handling, and that the data can be reorganized without changing the user interface. The model-view-controller design pattern solves this problem by decoupling data access and business logic from data presentation and user interaction, by introducing an intermediate....!
Database testing basically include the following. 1)Data validity testing. 2)Data Integritity testing 3)Performance related to data base. 4)Testing of Procedure,triggers and functions. for doing data validity testing you should be good in SQL queries For data integrity testing you should know about referintial integrity and different constraint. For performance related things you should have idea about the table structure and design. for testing Procedure triggers and functions you should be able to understand the sam....! string urlencode(str) where str contains a string like this “hello world” and the return value will be URL encoded and can be use to append with URLs, normaly used to appned data for GET like someurl.com?var=hello%world string urldocode(str) this will simple decode the GET variable’s valueLike it echo (urldecode($_GET_VARS[var])) will output “Hello world” ....! you can achieve this using curl in php see the example below. function curl_get_con_url($url, $user_agent = '', $referer = '') { // create a new CURL resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); /* This lines will make sure that you can save the web page into a variable */ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CUR....! The Session Manager session support allows multiple server instances to share a common pool of sessions, known as a session cluster Session clustering setting up methods : #1)First methods, is to have a NFS shared where session will be store. Setting this is quite easy, just a little modification on php.ini file to change the “session.save_path ? directive to point to the NFS share. The main problem with NFS is on high traffic, NFS share is really slow. So synchronisation and data corruption can arrive and ....! Set char to occupy n bytes and it will take n bytes even if u r storing avalue of n-m bytes Set varchar to occupy n bytes and it will take only the required space and will not use the n bytes eg. name char(10) will waste 5 bytes if we store ‘testname’, if each char takes a byteeg. name varchar(10) will just use 5 bytes if we store ‘testname’, if each char takes a byte. rest 5 bytes will be free. ....! <?php session_start(); $_SESSION["var"] = NULL; echo $var = "www.w3answers.com"; ?> The output : www.w3answers.com and warning as below Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a ....! <?php echo $second = date("s"); ?> ....! www.w3answers.com w3answers.blogspot.com <?php $array=array(5,5,5); echo $r=array_pad($array,5,2); ?> Ans:Array NOTE: use 'foreach($r as $v)' then try to output value 'echo $v' or use Print_r($r) so if we make above script as <?php $array=array(5,5,5); $r=array_pad($array,5,2); foreach($r as $v) echo $v; ?> We get the output as 55522 Authentication is the process of determining whether someone or something is, in fact, who or what it is declared to be. In private and public computer networks (including the Internet), authentication is commonly done through the use of logon passwords. Knowledge of the password is assumed to guarantee that the user is authentic. Each user registers initially (or is registered by someone else), using an assigned or self-declared password. On each subsequent use, the user must know and use the previously declared password. The weakness in this syst....!

Authentication is the process of determining whether someone or something is, in fact, who or what it is declared to be. In private and public computer networks (including the Internet), authentication is commonly done through the use of logon passwords. Knowledge of the password is assumed to guarantee that the user is authentic. Each user registers initially (or is registered by someone else), using an assigned or self-declared password. On each subsequent use, the user must know and use the previously declared password. The weakness in this syst....!