Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 7.13 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  5.     <title>Database</title>
  6.     <base href="https://atalkez.000webhostapp.com/" />
  7.             <meta name="viewport" content="width=992" />
  8.         <meta name="description" content="" />
  9.     <meta name="keywords" content="" />
  10.     <!-- Facebook Open Graph -->
  11.     <meta name="og:title" content="Database" />
  12.     <meta name="og:description" content="" />
  13.     <meta name="og:image" content="" />
  14.     <meta name="og:type" content="article" />
  15.     <meta name="og:url" content="https://atalkez.000webhostapp.com/Database" />
  16.     <!-- Facebook Open Graph end -->
  17.        
  18.     <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
  19.     <script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>
  20.     <script src="js/bootstrap.min.js" type="text/javascript"></script>
  21.     <script src="js/main.js?v=20171208164322" type="text/javascript"></script>
  22.  
  23.     <link href="css/font-awesome/font-awesome.min.css?v=4.7.0" rel="stylesheet" type="text/css" />
  24.     <link href="css/site.css?v=20171211095857" rel="stylesheet" type="text/css" />
  25.     <link href="css/common.css?ts=1513284372" rel="stylesheet" type="text/css" />
  26.     <link href="css/2.css?ts=1513284372" rel="stylesheet" type="text/css" />
  27.    
  28.     <script type="text/javascript">var currLang = '';</script>     
  29.     <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
  30.     <!--[if lt IE 9]>
  31.       <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  32.     <![endif]-->
  33. </head>
  34.  
  35.  
  36. <body><div class="root"><div class="vbox wb_container" id="wb_header">
  37.    
  38. <div class="wb_cont_inner"><div id="wb_element_instance19" class="wb_element wb-menu"><ul class="hmenu"><li><a href="Home/" target="_self" title="Home">Home</a></li><li><a href="https://www.achaea.com/" target="_self" title="About">About</a></li><li><a href="Bio/" target="_self" title="Bio">Bio</a></li><li class="active"><a href="Database/" target="_self" title="Database">Database</a></li></ul><div class="clearfix"></div></div><div id="wb_element_instance20" class="wb_element" style=" line-height: normal;"><h4 class="wb-stl-pagetitle" style="text-align: center;">Atalkez of Achaea</h4>
  39. </div><div id="wb_element_instance21" class="wb_element wb_element_picture"><img alt="gallery/achaea logo" src="gallery_gen/ce25e0167f53ee4a775efa5089316bea_70x70.png"></div></div><div class="wb_cont_outer"></div><div class="wb_cont_bg"></div></div>
  40. <div class="vbox wb_container" id="wb_main">
  41.    
  42. <div class="wb_cont_inner"><div id="wb_element_instance23" class="wb_element" style=" line-height: normal;"><h2 class="wb-stl-heading2"><span class="wb-stl-highlight">Enemies</span></h2>
  43.  
  44. <p class="wb-stl-normal"> </p>
  45.  
  46. <p class="wb-stl-normal">Achaea is a MMORPG, which means there are many players that play the game. It's also an open world, which allows players to do pretty much whatever they want. Due to this, there obviously are some various contentions (both crucial to the game such as factions, and regular petty squabbles alike) which can lead to enemity between players and/or organizations. As such, we have city and personal enemies. The following is a quick database for Enemies of the city Targossas, both to search and to input new ones. This page is purely for demonstration of database management using PHP, MYSQL, and HTML scripting. The enemy list is kept small to ensure the database scope is minimal.</p>
  47. </div><div id="wb_element_instance24" class="wb_element wb_element_shape"><div class="wb_shp"></div></div><div id="wb_element_instance25" class="wb_element" style=" line-height: normal;"><p class="wb-stl-normal" style="text-align: center;">Atalkez vs Aegoth</p>
  48. </div><div id="wb_element_instance26" class="wb_element" style=" overflow: hidden;">
  49.  
  50.  
  51.     <h5>Add Enemy to Database</h5>
  52.  
  53.  
  54.   <form action="insert_enemy.php" method="post">
  55.       <table border="1"><tr><td>Enemy name</td>
  56.           <td><input type="text" name="name" maxlength="10"><br></td></tr><tr><td>Faction</td>
  57.           <td><input type="text" name="faction" maxlength="10"><br></td></tr><tr><td>
  58.           <input type="submit" value="Update Enemy List"></td></tr></table></form>
  59.  
  60. </div><div id="wb_element_instance27" class="wb_element" style=" overflow: hidden;"><!--
  61. Document to connect to database, then display the entire contents
  62. Again, doesn't display properly because it can't connect to then
  63. database properly. Web service denies the request.
  64.  
  65. Troubleshoot: I've tried to use the GRANT command, but I do not have
  66. the authority on the service. I tried deleting and re-declaring the database,
  67. and I tried to manually change the user/password - nothing worked.
  68.  
  69. Works fine when I use localhost
  70.  
  71. -->
  72.  
  73.  
  74.  
  75.    
  76.         <title>Enemy List Database</title>
  77.     &lt;?php
  78.         $dbServerName = "databases.000webhost.com"; //change to website URL
  79.         $dbUsername = "id3562886_test"; //change to website database username
  80.         $dbPassword = "testing"; //change to website database password
  81.         $dbName = "id3562886_enemylist"; //database name, may need to change
  82.  
  83.         $conn = mysqli_connect($dbServerName, $dbUsername, $dbPassword, $dbName);
  84.         if (!$conn)
  85.         {
  86.             echo "Error: Could not connect to database. Please try again.";
  87.             die;
  88.         }
  89.  
  90.         mysqli_select_db($dbName);
  91.         //Statements to output entire table data
  92.         $query = "SELECT * FROM enemies;";
  93.         $result = mysqli_query($query);
  94.         $resultCheck = mysqli_num_rows($result);
  95.         echo "<p>Number of Enemies: ".$resultCheck."</p>";
  96.         for ($i=0;i ";
  97.             echo $row['enemyID'];
  98.             echo $row['enemyName'];
  99.             echo $row['enemyCity'];
  100.         }
  101.     ?&gt;
  102.    
  103. </div><div id="wb_element_instance28" class="wb_element" style="width: 100%;">
  104.                         <script type="text/javascript">
  105.                 $(function() {
  106.                     $("#wb_element_instance28").hide();
  107.                 });
  108.             </script>
  109.                         </div></div><div class="wb_cont_outer"></div><div class="wb_cont_bg"></div></div>
  110. <div class="vbox wb_container" id="wb_footer">
  111.    
  112. <div class="wb_cont_inner" style="height: 134px;"><div id="wb_element_instance22" class="wb_element" style=" line-height: normal;"><p class="wb-stl-footer">© 2017 <a href="http://atalkez.000webhostapp.com">atalkez.000webhostapp.com</a></p></div><div id="wb_element_instance29" class="wb_element" style="text-align: center; width: 100%;"><div class="wb_footer"></div><script type="text/javascript">
  113.             $(function() {
  114.                 var footer = $(".wb_footer");
  115.                 var html = (footer.html() + "").replace(/^\s+|\s+$/g, "");
  116.                 if (!html) {
  117.                     footer.parent().remove();
  118.                     footer = $("#wb_footer, #wb_footer .wb_cont_inner");
  119.                     footer.css({height: ""});
  120.                 }
  121.             });
  122.             </script></div></div><div class="wb_cont_outer"></div><div class="wb_cont_bg"></div></div><div class="wb_sbg"></div></div><div style='text-align: right;position: fixed;z-index:9999999;bottom: 0; width: 100%;cursor: pointer;line-height: 0;display:block !important;'><a title="Hosted on free web hosting 000webhost.com. Host your own website for FREE." target="_blank" href="https://www.000webhost.com/?utm_source=000webhostapp&amp;utm_campaign=000_logo&amp;utm_medium=website_atalkez&amp;utm_content=footer_img"><img src="https://cdn.rawgit.com/000webhost/logo/e9bd13f7/footer-powered-by-000webhost-white2.png"  alt="www.000webhost.com"></a></div></body>
  123. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement