Check Teer Result

How to echo hello world in php

How to echo "Hello World" in Php :-

What is PHP ?
PHP is a very interesting language. a web page created on normal HTML language can be seen on right click on it. But PHP is a secure language which is not viewable normally. So we can say that using PHP in our site is very useful as hackers have to think about it's not easy to hack. We can add more security as we wish in our admin panel. we can encrypt our password. Now many open source software is available in our market like Wordpress, Joomla etc for creating dynamic websites. But if we aware of PHP language with MYSQL (Database Knowledge) we can easily create our own CMS (Content Management System). We can modify it according to our wish. Some of the site such as facebook, Examdoor has their own CMS to modify according to their own wish



<?php
echo "<center><h1>Hello world</h1></center>"; 
?>

How can we write PHP Code?
Generally PHP code does not run in a browser. So we have to install wamp or xamp server in our system.

Some of the website made on PHP are -
1. Facebook.com (Social Networking Website)
2. Examdoor.in (Jobs Site)

How to install Wamp server?
http://www.wampserver.com/en/

We will use Notepad ++ and Google Chrome Browser

<!DOCTYPE html>
<html>
<body>
<?php
echo "My first PHP script!";
?>
</body>
</html>

Learn How to Set Wamp Server in Windows PC -






How to create a simple calculator using PHP 

So we will learn on this session, how to create a simple calculator on PHP 

<?php
  if(isset($_POST['submit'])){
  $num1 = $_POST['number1'];
  $num2 = $_POST['number2'];
  
  $result = $num1 + $num2;
  
  echo "<center><h2>$num1 + $num2 = $result</h2></center>";
  }



?>
<form method="post" action="calcu.php" enctype="multipart/form-data">
   Enter Numer One : <input type="text" name="number1"/><br>
   Enter Numer two : <input type="text" name="number2"/><br>
   <input type="submit" name="submit"/>
</form>

Now we will learn the above code with video tutorial :- 






EmoticonEmoticon