How are placeholders used in PHP database programming?
Placeholders in an abstraction layer such as PDO in PHP allows for caching and security in database queries (they fight SQL injection).
Which parts of php are case sensitive and which are not?
Case Sensitive parts of php include:
Case Insensitive parts of php include:
Explain the categories of PHP Operators in web technology?
There are arithmetic operators (+, -, %, ++, etc.), comparison operators (<, ==, >=, !=, etc.), logical operators (&&, !, , etc.), assignment operators (=, *=, %=, +=, etc.), conditional operator (?:).
The order of operations is unary (!, ++, --), multiplicative (left to right; *, /, %), additive (left to right; +, -), relational (left to right; <, <=, >, >=), equality (left to right; ==, !=), logical and (left to right; &&, and), logical or (left to right; , or), conditional (?:), assignment.
Your PHP file does not have the required permissions to open that file with write capabilities. Try Granting higher permissions (777, etc) to the PHP file itself, and / or GPleskVhostswallnutclan.comhttpdocstest.php.
What are the similarities between php statement and javascript statement?
Which statement is used to execute some code only if a specified condition is true?
if ($condition == true) {
codeToRun();
}
Which character is usually used to terminate PHP statement?
A semicolon ( ; ) is often used at the end of an expression to conclude it and hopefully the line as well. If this is in reference to a block of code, the answer could be a closing curly bracket ( } ). If this is in reference to all of your PHP in a given area, a closing tag would be used ( ?>).
What is the use of php in seo?
SEO (Search Engine Optimization) is used for webpages be it php, asp.net or perl. Not the other way round.
What character allows you to concatenate strings in PHP?
To concatenate strings in PHP, you use the . (dot) character.
For example:
$str = "String1" . "String2";
How do you write a program to print numbers from star one and next line star two in php?
Try the triangle program on a search engine. Replace numbers with stars and that should do the trick
One of the web servers for php which supports coding in PERL programming
How validate and retrieve data from database?
It is better to validate the data going into the database for errors rather then data coming out. The data to be retrieved can be done using the $_REQUEST or mysql_fetch_array or PDO statements. I am giving 2 simple examples
// The connection string or function here to connect to database
// Put the name of your database in place of db_name
mysql_select_db("db_name");
// Enter the name of table in place of table_name
$query = mysql_query("SELECT * FROM table_name");
while($fetch = mysql_fetch_array($query))
{
// add your table column names in the square blocks
echo $fetch['Name']."
";
echo $fetch['email']."
";
}
?>
If you want a particular data that can be obtained by using the where clause
The ID would come from user input
$data = $_REQUEST['ID'];
// Enter the name of table in place of table_name
$query = mysql_query("SELECT * FROM table_name WHERE ID='$data'");
while($fetch = mysql_fetch_array($query))
{
// add your table column names in the square blocks
echo $fetch['Name']."
";
echo $fetch['email']."
";
}
?>
PHP code can be stored in any kind of file -- the extension of the file indicates what said file contains, but may not necessarily be true.
The "php" extension is used to indicate PHP which is meant for execution and presentation.
How do decrypt the password in php?
If the encryption is applied using md5, decrypting is normally impossible (emphasizes on normally).
PHP is a server-side scripting language that can be used to dynamically generate the content of web sites served up to a client. It can also be used for local shell scripting.
PHPMyAdmin is a PHP based web interface for managing MySQL databases.
How do you use a function with a button in PHP?
A simple function call
<html>
<body>
<?php
if(isset($_POST['button']))
{
setValue(); // Function is called
}
function setValue()
{
echo "<br>The button property to call PHP function works";
// Your code here
}
?>
<input type="submit" name="button" onclick=<?php $_SERVER['PHP_SELF']; ?> />
</body>
</head>
What do you use to separate multiple arguments that are passes to a function?
Commas.
The call looks like:
$returnValue = ourCrazyFunction($arg1, $arg2, $arg3);
What is the first step to use in detecting data type mismatch errors?
Better if you use javascript or another scripting language to analyse what is sent to the server in the first place. Most of the browsers support javascript.
Suppose there is an input type of text of the simple html form
function checkData()
{
var char = /^[a-zA-Z]+$/;
var num= /^[0-9]+$/;
var name = document.getElementById("name");
var age = document.getElementById("age");
if(name.value==""name.value.match(num))
{
alert("Namespace cannot contain numericals!!");
return false;
}
else if(age.value==""age.value.match(char))
{
alert("Age cannot be empty or contain characters!!");
return false;
}
else
{
form1.form.submit();
return true;
}
}
// The neat little code tells if javascript is enabled/disabled in browser
Most of things would be easy this way but alas things aren't so easy. You also need to validate data on the server side using echo statements & control loops before finally posting data in mysql table
Primarily it is applied for creating web applications and websites which deal with client-server model. Use mysql db with php and you could build a three tire architecture. Couple of big website like Facebook do use php.
PHP is related with HTML. HTML can be included into PHP script as well as PHP script can be included into HTML code. PHP begins and ends with <?php ?>. PHP is mix of few languages so semantics is mixed too.
What is the actual meaning of PHP?
It is a programming language.
PHP is short for "PHP: Hypertext Preprocessor"
PHP was originally developed in 1995 by Rasmus Lerdorf. In 1997 it became much more similar to the PHP we know today when the parser was rewritten by Zeev Suraski and Andi Gutmans. It is now maintained by a large community of developers, with several key figures leading the way.
isset( $var ) is a PHP function which returns TRUE or FALSE depending on whether a specified $var has been assigned to any value (or, initialized).