Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title> Web Programming </title>
- </head>
- <body>
- Selamat pagi PHP!!!<br>
- <?php
- echo "Tarikh ".date('D, d M Y');
- ?>
- <p>Variables</p>
- <?php
- //php vaiable
- $username="ali";
- $password="ali123";
- //display values
- echo "Hi username $username <br>";
- //concatenation
- echo "with password ". $password;
- ?>
- <br>
- <h3>Form input </h3>
- <form method="get" action="">
- Number1
- <input name="n1" type="text"><br>
- Number2
- <input name="n2" type="text"><br>
- <input type="submit" value="ADD">
- </form>
- <br>Answer:
- <?php
- //capture data from textbox
- $n1=$_GET['n1'];
- $n2=$_GET['n2'];
- //display result
- echo "$n1 + $n2 = ".$n1+$n2;
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement