We need apache or nginx server to run php codes. I'l tell you about nginx later. Now we will use apache services in windows. Xampp is one of open source software that provide apache service. I hope you've already installed xampp in your computer. If you have not installed it, please go to installing xampp. If you have already installed, lets start writing the codes and test it.
1. Go to C > xampp > htdocs and create include (folder) in htdocs.
2. Write the following codes and save it as form.php .
<php
?>
<style type = "text/css">
body{width: 300px; height: 220px; border: solid green 1px;
margin-top:250px; margin-left: 40px;}
form{margin-top: 30px; text-align: center;}
</style>
<body>
<form action = "form.php" method = "POST">
Username </br>
<Input type = "text" name = "username"></br></br>
Password </br>
<input type = "password" name = "password"></br></br>
<input type = "submit" value = "LogIn">
</form>
</body>
3. Now, open your browser and type localhost/include/form.php in your browser. And then, you will see the following picture.
4. Now we will write the following codes and save it as index.php .
<?php
echo 'Hello!, Welcome to T N W. This is PHP Testing.';
//require "form.php"
include "form.php";
?>
5. Open your browser and type localhost/include in it. And then, you will see the following picture.
Download Android Application
No comments:
Post a Comment