Technology Questions

Q:

Explain when to use GET or POST. Provide example for both the ways.

Answer

Both GET and POST are used to collect data from a form. However, when security is desired $_POST should be used. When the $_ POST variable is used, all variables used are NOT displayed in the URL. Also, they have no restrictions to the length of the variables. GET should be used when the interaction with the form is more like a question. For e.g. firing a query etc. POST should be used more often when the interaction is more like an order or the interaction changes the state of the resource.


POST example:


<form action="sample.php" method="post">


Name: <input type="text" name="name" />


Age: <input type="text" name="age" />


<input type="submit" />


</form>


On clicking submit the URL resembles to: https://www.mysamplesite.com/sample.php


The sample.php file can be used for catching the form data using $_POST 


Hello <?php echo $_POST["name"]; ?>.<br />


You are <?php echo $_POST["age"]; ?> years old!


 


GET EXAMPLE


<form action="sample.php" method="get">


Name: <input type="text" name="name" />


Age: <input type="text" name="age" />


<input type="submit" />


</form>


On clicking submit the URL resembles to : https://www.mysamplesite.com/sample.php?name=jim&age=37


The sample.php file can be used for catching the form data using $_GET 


Hello <?php echo $_GET["name"]; ?>.<br />


You are <?php echo $_GET["age"]; ?> years old!

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 4314
Q:

What is PHP’s configuration file called ?

Answer

PHP’s configuration file is called php.ini.

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

6 4311
Q:

Server control events are handled in the server whereas HTML control events are handled in the page

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:

Server control events can be handled inside a server itself

Report Error

View Answer Workspace Report Error Discuss

Subject: Web Technology
Job Role: Software Architect

0 4302
Q:

List out the areas in which data structures are applied extensively?

Answer

Compiler Design,


 Operating System,


 Database Management System,


Statistical analysis package,


Numerical Analysis,


 Graphics,


 Artificial Intelligence,


 Simulation

Report Error

View answer Workspace Report Error Discuss

Subject: C++

4 4297
Q:

How the different permutations are ordered in c++?

A) Compare lexicographicaly to each other elements B) By finding the highest element in the range
C) By finding the lowest element in the range D) None of the mentioned
 
Answer & Explanation Answer: A) Compare lexicographicaly to each other elements

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 4287
Q:

How can you generate debugging output from PL/SQL?

Answer

Use the DBMS_OUTPUT package. Another possible method is to use the SHOW ERROR command.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 4286
Q:

Series of interface points that allow other computers to communicate with the other layers of network protocol stack is called SAP

A) TRUE B) FALSE
Answer & Explanation Answer: A) TRUE

Explanation:
Report Error

View Answer Workspace Report Error Discuss

1 4250
Q:

Explain the working with directories using opendir(), readdirs(), closedir() along with examples.

Answer

Opendir():- It opens the directory. This function returns a directory stream on success and FALSE and an error on failure.


Syntax:


Opendir(directory, context)


Context is a set of options that can modify the behavior of a stream


Example: opens sample directory.


$dir = opendir("directory");


 


Readdir(): It returns an entry from a directory handle opened by opendir().


Syntax:


Readdir(dir_stream)


Example:


$file = readdir($dir);


 


closedir(): It closes a directory handle opened by opendir().


Syntax:


closedir(dir_stream)


Example:


$file = close($dir);

Report Error

View answer Workspace Report Error Discuss

Subject: PHP

0 4249