[vc_row][vc_column][vc_custom_heading text=”PHP Syntax”][vc_column_text]The PHP parsing engine needs a way to differentiate PHP code from other elements in the page. The mechanism for doing so is known as ‘escaping to PHP’. There are four ways to do this −[/vc_column_text][vc_custom_heading text=”Canonical PHP tags”][vc_column_text]The most universally effective PHP tag style is − <?php ... ?> If you use this style, you can be positive that your tags will always be correctly interpreted.[/vc_column_text][vc_custom_heading text=”Short-open (SGML-style) tags”][vc_column_text]Short or short-open tags look like this − <? ... ?> [/vc_column_text][vc_column_text]Short tags are, as one might expect, the shortest option You must do one of two things to…
-
-
[vc_row][vc_column][vc_column_text]In order to develop and run PHP Web pages three vital components need to be installed on your computer system.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][ul] Web Server − PHP will work with virtually all Web Server software, including Microsoft’s Internet Information Server (IIS) but then most often used is freely available Apache Server. Database − PHP will work with virtually all database software, including Oracle and Sybase but most commonly used is freely available MySQL database. PHP Parser − In order to process PHP script instructions a parser must be installed to generate HTML output that can be sent to the Web Browser. This tutorial will guide you…
-
[vc_row][vc_column][vc_column_text]The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. This tutorial helps you to build your base with PHP.[/vc_column_text][vc_custom_heading text=”Why to Learn PHP?”][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]PHP started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994. PHP is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Web Development Domain. I will…
-
Here, gettype() function is used to get the datatype of the variables. Syntax gettype($variable); <?php $a=10; $b=10.98; $c="Hello"; echo "$a is ".gettype($a); echo "<br> $b is ".gettype($b); echo "<br> $c is ".gettype($c); ?> OutPut 10 is integer 10.98 is double Hello is string
-
Here, Dot(.) is used to concate the statements. <br> tag is used to break the line. <?php $a=10; $b=20; echo "Value of a = $a"."<br>"; echo "Value of b = $b"."<br>"; echo "<br> ***Arithmetic Operator*** <br>"; $c=$a+$b; echo "Addition of $a and $b = $c"."<br>"; $c=$a-$b; echo "Subtraction of $a and $b = $c"."<br>"; $c=$a*$b; echo "Multiplication of $a and $b = $c"."<br>"; $c=$a/$b; echo "Division of $a and $b = $c"."<br>"; echo "<br> ***Comparison Operator*** <br>"; if($a>$b) { echo "$a is greater than $b <br>"; } else if($a<$b) { echo "$a is less then $b <br>"; } else if($a==$b)…
-
Here echo is used to print something in output console. $ is used with variable, in PHP all variables are precedes with $ sign, you have to use $ with all variables. Every line of code must be ended with semicolon (;). Note that every PHP Script must start with <?php and ended with ?>, this means whole script must be written between <?php …. ?>. <?php $a= "Hello World!"; echo $a."<br>"; ?> OutPut Hello World!
-
Here, <link> tag contains rel attribute which is used to control printing of various language. <html> <head> <title>Google</title> <link rel="stylesheet"href="https://fonts.googleapis.com/css?family=Tangerine"> </head> <body> <table align="right" cellpadding="5" cellspacing="5" > <td><a href="" style="color:black;text-decoration:none">Gmail</a></td> <td><a href="" style="color:black;text-decoration:none">Images</a></td> <td><img src="gmenu.png" style="width:25px ; height:25px" /> <td><input type="submit" value="Sign in" style="width:70px ; height:30px;background- color:#4c4cff; color:#FFFFFF;border:none; border-radius:3px;font-weight: bold" /></td> </table> <div align="center" style="padding:130"> <img src="Google.png" style="width:430px ;height:140px;margin-left:90" /> <input type="search" style="width:550px; height:42px; background:transparent;border:2px outset #f1f4f2;margin-left:100" /> <img src="voice.png" style="width:20px ; height:30px" /><br><br> <input type="submit" name="search" value="Google Search" style="width:130px; height:35px; background-color:#f1f4f2;border:none;border-radius:3px;color:#6f8877;font-weight: bold;margin-top:20;margin-left:90"> <input type="submit" name="lucky" value="I'm Feeling Lucky" style="width:130px; height:35px; background-color:#f1f4f2;border:none;border-radius:3px;font-weight: bold;color:#6f8877"> <table style="margin-left:120;font-size:15"> <td>Google offered in :</td> <td><a…
-
<div> tag is used to create the container in webpage. It will used to design some portion of webpage. <html> <head> <title>Content</title> </head> <body bgcolor="brown"> <div style="background-color:grey;color:white;font-size:25px" align="center"> <p>Different Types Of Functions Are Displayed Here...</p> <p>Content Display Here</p></h1> </div> </body> </html> OutPut
-
<html> <head> <title>Contact Form</title> <style type="text/css"> td { font-size: 15pt; } </style> </head> <body align="center" bgcolor="#83ccd2"> <h2><b><u>CONTACT FORM</u></b></h2> <form method="post" name="contactform" action="cform.php"> <table align="center" border=3 bordercolor="black"> <tr> <td>Name : </td> <td><input type="text" name="name" placeholder="Firstname Secondname Lastname" size="40" required></td> </tr> <tr> <td>Email : </td> <td><input type="email" name="email" placeholder="abc123@gmail.com" size="40" required></td> </tr> <tr> <td>Mobile No. : </td> <td><input type="number" name="mno" placeholder="0123456789" required></td> </tr> <tr> <td>Message : </td> <td><textarea rows="7" cols="25" name="msg" placeholder="Write Your Message Here"></textarea></td> </tr> <tr> <td><input type="submit" name="submit" value="SUBMIT"></td> <td><input type="reset" name="reset" value="RESET"></td> </tr> </table> </form> </body> </html> OutPut
-
<style> tag is used to apply the css. <form> tag is used to used form attributes. <table> tag is used to create table. <tr> tag creates the row and <td> tag is used to create the column. <th> tag is used to apply header row for table. <html> <head> <title>Feedback Form</title> <style type="text/css"> td { font-size: 15pt; } </style> </head> <body align="center" bgcolor="#cd93cc"> <h2><b><u>FEEDBACK FORM</u></b></h2> <form method="post" name="feedbackform" action="fform.php"> <table align="center" border=3 bordercolor="black"> <tr> <td>Name : </td> <td><input type="text" name="name" placeholder="Firstname Secondname Lastname" size="40"></td> </tr> <tr> <td>Enrollment No. : </td> <td><input type="number" name="mno" placeholder="166470307001"></td> </tr> <tr> <td>Email : </td> <td><input…