Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PHP Basics
- ==========
- Server Side Scripting Language
- <?php
- xxxx
- xxxx
- xxxx
- xxxx
- ?>
- <?php ---> Start of PHP code
- ?> ---> End of php code
- echo "Hello Guys"
- $var --> var is name of variable
- $hack --> Hack is name of variable
- $ ---> used to declare a variable
- $_POST
- $_GET
- =========
- CALL.html
- =========
- <html>
- <head>
- <title>Calculator</title>
- </head>
- <body>
- <form action="calc.php" method="post" attribute="post">
- First Value : <input type="text" id="first" name="first"><br>
- Second Value : <input type="text" id="second" name="second"><br>
- <input type="radio" name="group1" id="add" value="add" checked="true">ADD<br>
- <input type="radio" name="group1" id="subtract" value="subtract">SUBTRACT<br>
- <button type="submit" id="answer" value="answer">Calculate</button>
- </form>
- </body>
- </html>
- ========
- calc.php
- ========
- <html>
- <head>
- <title>Calculator</title>
- </head>
- <body>
- <p>
- The Answer is:
- <?php
- $first=$_POST['first'];
- $second = $_POST['second'];
- if($_POST['group1'] == 'add')
- {
- $ans=$first+$second;
- echo $ans;
- }
- if($_POST['group1'] == 'subtract')
- {
- $ans=$first-$second;
- echo $ans;
- }
- ?>
- </p>
- </body>
- </html>
- don.html
- =========
- <html>
- <head>
- <title>Me Hu DON</title>
- </head>
- <body>
- <h1>Hackers</h1>
- <h2>Mr. Ravi Raman</h2>
- <p>I am Naval Oficer.<br>
- I am an executive Officer.<br>
- I am 35 years old.<br>
- I am communication specialist.<br>
- </p>
- <a href="https://en.wikipedia.org/wiki/Black_hat">
- <h3>Mr. Madhu</h3>
- </a>
- <h4>Mr. Hothi</h4>
- <img src="spidy.jpg" width="500"></img>
- <h5>Mr. Devdas</h5>
- <iframe src="http://www.lucideus.com"></iframe><br><br><br><br><br><br><br><br>
- <form action="sec.php" method="POST">
- Username :<input type="text" id="user" name="users"><br><br>
- Password :<input type="password" id="pass" name="passes"><br><br>
- <input type="submit" value="Login">
- </form>
- </body>
- </html>
- sec.php
- =======
- <html>
- <head>
- <title>SuperHero</title>
- </head>
- <body>
- <h1>This Is My Fav. SuperHero</h1>
- <img src="shakti.jpg">
- <?php
- $username=$_POST['users'];
- $password=$_POST['passes'];
- if($username == "admin")
- {
- echo "Welcome to password protected area admin";
- if($password="passes")
- {
- echo "Welcome admin";
- }
- else
- {
- echo "Wrong password";
- }
- }
- else
- {
- echo "Wrong username";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement