Guest User

WDL experiment 2-6

a guest
Oct 26th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 8.42 KB | None | 0 0
  1.                    <!-----------------------------Experiment 2----------------------------->
  2.  
  3. <!--------------------------------------Create Simple html webpage---------------------------------->
  4.  
  5.                  
  6.  
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10.     <title>Sample Web Page</title>
  11.     <style>
  12.         h1{
  13.             padding-top: 50px;
  14.             color: rgba(255,255,255,0.9);
  15.         }
  16.  
  17.         img{
  18.             padding-top: 30px;
  19.         }
  20.  
  21.         p{
  22.             padding: 40px 60px;
  23.             text-align: justify;
  24.             color: rgba(255,255,255,0.9);
  25.             font-family: sans-serif;
  26.             font-weight: bold;
  27.             font-size: 18px;
  28.         }
  29.        
  30.        
  31.     </style>
  32. </head>
  33. <body>
  34.     <div align="center">
  35.         <h1>Player Unknown's: BattleGrounds(PUBG)</h1>
  36.         <img src="pubg.jpg">  
  37. <!------download any image from google and save it with the name pubg.jpg n the same folder where the cod is saved--->
  38.         <p>PlayerUnknown's Battlegrounds (PUBG) is an online multiplayer battle royale game developed and published by PUBG Corporation, a subsidiary of South Korean video game company Bluehole. The game is based on previous mods that were created by Brendan "PlayerUnknown" Greene for other games using the film Battle Royale for inspiration, and expanded into a standalone game under Greene's creative direction. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting killed themselves. The available safe area of the game's map decreases in size over time, directing surviving players into tighter areas to force encounters. The last player or team standing wins the round.</p>
  39.     </div>
  40. </body>
  41. </html>
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.     <!-----------------------------Experiment 3----------------------------->
  54.  
  55. <!--------------------------------------Create Simple html and css webpage------------------------------->
  56.  
  57. <!DOCTYPE html>
  58. <html>
  59. <head>
  60.     <title>Sample Web Page</title>
  61.     <style>
  62.         body{
  63.             background-color: yellow;
  64.         }
  65.         a{
  66.             font-size: 40px;
  67.             color: blue;
  68.             text-decoration: none;
  69.         }
  70.         a:hover{
  71.             color: red;
  72.         }
  73.  
  74.         img{
  75.             padding-top: 30px;
  76.         }
  77.  
  78.         p{
  79.             padding: 40px 60px;
  80.             text-align: justify;
  81.             color: black;
  82.             font-family: sans-serif;
  83.             font-weight: bold;
  84.             font-size: 18px;
  85.         }
  86.        
  87.  
  88.         table,tr,th,td{
  89.             border: 1px solid black;
  90.             border-collapse: collapse;
  91.            
  92.         }
  93.         tr,th,td{
  94.             padding: 10px;
  95.             font-size: 15px;
  96.         }
  97.         th,td{
  98.             background-color: white;
  99.             opacity: 0.4;
  100.         }
  101.         td:hover{
  102.             opacity: 1;
  103.         }
  104.         img:hover{
  105.             opacity: 0.8;
  106.         }
  107.        
  108.        
  109.     </style>
  110. </head>
  111. <body>
  112.     <div align="center">
  113.         <a href="https://www.pubgmobile.com/" target="_blank">Player Unknown's: BattleGrounds(PUBG)</a>
  114.         <br>
  115.         <img src="pubg.jpg">  
  116. <!------download any image from google and save it with the name pubg.jpg n the same folder where the cod is saved--->
  117.         <p>PlayerUnknown's Battlegrounds (PUBG) is an online multiplayer battle royale game developed and published by PUBG Corporation, a subsidiary of South Korean video game company Bluehole. The game is based on previous mods that were created by Brendan "PlayerUnknown" Greene for other games using the film Battle Royale for inspiration, and expanded into a standalone game under Greene's creative direction. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting killed themselves. The available safe area of the game's map decreases in size over time, directing surviving players into tighter areas to force encounters. The last player or team standing wins the round.</p>
  118.  
  119.         <table>
  120.             <tr>
  121.                 <th>Player</th>
  122.                 <th>Medal</th>
  123.                 <th>Rank</th>
  124.             </tr>
  125.             <tr>
  126.                 <td>DungeonMaster</td>
  127.                 <td>Platinum II</td>
  128.                 <td>33</td>
  129.             </tr>
  130.             <tr>
  131.                 <td>Nicolas</td>
  132.                 <td>Diamond II</td>
  133.                 <td>38</td>
  134.             </tr>
  135.             <tr>
  136.                 <td>BishuTheSlayer</td>
  137.                 <td>Crown V</td>
  138.                 <td>43</td>
  139.             </tr>
  140.         </table>
  141.     </div>
  142.    
  143. </body>
  144. </html>
  145.    
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155. <!--------------------Experiment 4------------------------>
  156. <!-------------------javascript form validation----------->
  157. <!DOCTYPE html>
  158. <html>
  159. <head>
  160.     <title>Registration Form</title>
  161.  
  162.     <!----------------Style/CSS code--------------------->
  163.     <style>
  164.         body{
  165.             padding: 0;
  166.             margin: 0;
  167.             background-color: yellow;
  168.         }
  169.  
  170.         form{
  171.             position: absolute;
  172.             top: 60px;
  173.             left: 500px;
  174.             font-size: 18px;
  175.             border: 1px solid black;
  176.             background-color: gold;
  177.             padding: 25px;
  178.         }
  179.  
  180.         input{
  181.             width: auto;
  182.             height: 20px;
  183.            
  184.         }
  185.  
  186.         h2{
  187.             margin-top: 0px;
  188.             text-align: center;
  189.             font-weight: bold;
  190.         }
  191.  
  192.  
  193.  
  194.         input[type="submit"]{
  195.            
  196.             margin-top: 30px;
  197.             height: 30px;
  198.             width: 300px;
  199.         }
  200.  
  201.     </style>
  202.  
  203.  
  204.     <!-------------javascript code--------------->
  205.     <script>
  206.     function validateForm(){
  207.         var fname= document.forms["Registration"]["Fname"];
  208.         var lname= document.forms["Registration"]["Lname"];
  209.         var address= document.forms["Registration"]["Address"];
  210.         var email= document.forms["Registration"]["Email"];
  211.         var phoneno= document.forms["Registration"]["Phoneno"];
  212.         var gender= document.forms["Registration"]["gender"];
  213.         if(fname.value == ""){
  214.             alert("Enter the First Name");
  215.             return false;
  216.         }
  217.         if(lname.value == ""){
  218.             alert("Enter the Last Name");
  219.             return false;
  220.         }
  221.         if(address.value == ""){
  222.             alert("Enter the Address");
  223.             return false;
  224.         }
  225.         if(email.value == ""){
  226.             alert("Enter the Email");
  227.             return false;
  228.         }
  229.         if(phoneno.value == ""){
  230.             alert("Enter the Phone Number");
  231.             return false;
  232.         }
  233.         if(gender.value == ""){
  234.             alert("Select the Gender");
  235.             return false;
  236.         }
  237.         return true;
  238.  
  239.     }
  240.     </script>
  241. </head>
  242.    
  243. <body>
  244.     <div class="Regester">
  245.         <form name="Registration" action="Website/index.html" onsubmit="return validateForm()" method="post">
  246.                
  247.             <h2>Registration form</h2>
  248.             <br><br>
  249.            
  250.                 First Name: <input type="text" name="Fname" >
  251.             <br><br>
  252.                 Last Name: <input type="text" name="Lname">
  253.            
  254.             <br><br>
  255.                 Address: <input type="text" name="Address">
  256.             <br><br>
  257.                 Email: <input type="email" name="Email">
  258.             <br><br>
  259.                 Phone Number: <input type="number" name="Phoneno">
  260.             <br><br>
  261.                 Gender:
  262.                     <input type="radio" name="gender">Male
  263.                    
  264.                     <input type="radio" name="gender">Female
  265.             <br><br>
  266.                 Course:
  267.                     <select>
  268.                         <option>Computer</option>
  269.                         <option>Mechancial</option>
  270.                         <option>Civil</option>
  271.                     </select>
  272.             <br><br>
  273.                 <input type="submit" value="Submit">
  274.         </form>
  275.     </div>
  276. </body>
  277. </html>
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288. <!-------------------------experiment 5----------------------->
  289. <!------------------------php--------------------------------->
  290. <!DOCTYPE html>
  291. <html>
  292. <head>
  293.     <title>My first PHP code</title>
  294. </head>
  295. <body>
  296.  
  297.  <h1>PHP PAGE!!</h1>
  298.  <?php
  299.     echo "Hello Nigga";
  300. ?>
  301.  
  302. </body>
  303. </html>
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321. <!------------------------------experiment 6-------------------------------------->
  322. <!---------------------------php and data connectivity-------------------------->
  323.  
  324.  
  325. <!---------------make signin.php and paste this code ad do save in c:xampp:htdocs---------------------->
  326.  
  327. <!DOCTYPE html>
  328. <html>
  329. <head>
  330. <style>
  331. body
  332. {
  333. background-color: yellow;
  334. text-align:center;
  335. }
  336. </style>
  337. <body>
  338. <h1>LOGIN PAGE</h1>
  339. <form action="login.php"method="POST">
  340. username:
  341. <input type="text"name="username"><br>
  342. password:
  343. <input type="password"name="password"><br><br>
  344. <input type="submit"value="submit">
  345. </form>
  346. </body>
  347. </html>
  348.  
  349.         <!-----------------make login.php and save in same location and make database name db and table name abc in mysql---                ------------------------------->
  350.  
  351.  
  352. <?php
  353. // get values from form in login.php file
  354.   $username = $_POST['username'];
  355.  
  356.   $password = $_POST['password'];
  357.  
  358. // to presvent mysql injection
  359.  
  360.      $username=stripcslashes($username);
  361.      $password=stripcslashes($password);
  362.      $username=mysql_real_escape_string($username);
  363.      $password=mysql_real_escape_string($password);
  364. // connect to the server and select databse
  365.    
  366.     mysql_connect("localhost", "root", "");
  367.     mysql_select_db("db");
  368. // query the database for user
  369.  
  370.     $result=mysql_query("select * from abc where username ='$username'
  371. and password ='$password'")
  372.     or die("failed to query database " .mysql_error());
  373.     $row= mysql_fetch_array($result);
  374.     if($row['username'] == $username && $row['password'] == $password)
  375.     {
  376.         echo "login success !" ;
  377.     }
  378.     else
  379.     {
  380.         echo "failed to login ";
  381.        
  382.     }
  383. ?>
Add Comment
Please, Sign In to add comment