google-site-verification=0G1GQku9D018TcyU0sVdxdCCA8PY0p57m_shC0p4zKc

REST METHOD USING PHP

PHP is open source general-purpose scripting language. It is used for web development and can be embedded into HTML.

This is basic example for embeded php.

<!DOCTYPE html>
<html>
    <head>
        <title>Project1</title>
    </head>
    <body>

        <?php
            echo “Hello World…”;
        ?>

    </body>
</html>

You should install WAMP, MAMP or XAMP servers before creating php projects. First we look what are the WAMP and XAMP. WAMP is stand for Windows, Apache, MySQL, and PHP. XAMP is stand for X stand for cross platformable and Apache, Maria DB and PHP. MAMP is used for Apple Computers and any other Apple devices. MAMP stand for Machintosh, Apache, My SQL and PHP.

This is download link for WAMP server : Download Wampserver 64bits – WampServer

This is download link for XAMP server : Download XAMPP (apachefriends.org)

We should know about My SQL now. What is My SQL?

MySQL is the world’s most popular open source database. With its proven performance, reliability and ease-of-use, MySQL has become the leading database choice for web-based applications, used by high profile web properties including Facebook, Twitter, YouTube, Yahoo! and many more.

Oracle drives MySQL innovation, delivering new capabilities to power next generation web, cloud, mobile and embedded applications.

This is download link for My SQL: MySQL :: MySQL Downloads

These are the tutorials for Php using Rest methods.

  • My SQL database connect using embeded PHP.
    • You should write html tags then include php tags to that file. If that file run you dont want above server softwares as WAMP, MAMP or XAMP.
  • My SQL database connect using pure PHP.
    • Other type is pure php. In this term we write only php tags It is more efficient than embeded method.

First we look up above Practicals

This is code for embeded php file

<?php

$name1 = “Nimal”;

$name2 = “Kamal”;

?>

<!DOCTYPE html>

<html lang=”en”>

<head>

    <meta charset=”UTF-8″>

    <meta http-equiv=”X-UA-Compatible” content=”IE=edge”>

    <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>

    <title>Document</title>

</head>

<body>

    <table border=”1″>

        <tr>

            <td>ID</td>

            <td>Name</td>

        </tr>

        <tr>

            <td>1</td>

            <td><?php echo($name1)?></td>

        </tr>

        <tr>

            <td>2</td>

            <td><?php echo($name2)?></td>

        </tr>

    </table>

</body>

</html>

This is code for pure PHP.

<?php

$name = “Nimal”;

$name = “Kamal”;

echo(“<table border=’1′>”);

    echo(“<tr>”);

            echo(“<td>ID</td>”);

            echo(“<td>Name</td>”);

    echo(“</tr>”);

    echo(“<tr>”);

            echo(“<td>1</td>”);

            echo(“<td>Nimal</td>”);

    echo(“</tr>”);

    echo(“<tr>”);

            echo(“<td>2</td>”);

            echo(“<td>Kamal</td>”);

    echo(“</tr>”);

echo(“</table>”);

?>