Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>Database</title>
- <base href="https://atalkez.000webhostapp.com/" />
- <meta name="viewport" content="width=992" />
- <meta name="description" content="" />
- <meta name="keywords" content="" />
- <!-- Facebook Open Graph -->
- <meta name="og:title" content="Database" />
- <meta name="og:description" content="" />
- <meta name="og:image" content="" />
- <meta name="og:type" content="article" />
- <meta name="og:url" content="https://atalkez.000webhostapp.com/Database" />
- <!-- Facebook Open Graph end -->
- <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
- <script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>
- <script src="js/bootstrap.min.js" type="text/javascript"></script>
- <script src="js/main.js?v=20171208164322" type="text/javascript"></script>
- <link href="css/font-awesome/font-awesome.min.css?v=4.7.0" rel="stylesheet" type="text/css" />
- <link href="css/site.css?v=20171211095857" rel="stylesheet" type="text/css" />
- <link href="css/common.css?ts=1513284372" rel="stylesheet" type="text/css" />
- <link href="css/2.css?ts=1513284372" rel="stylesheet" type="text/css" />
- <script type="text/javascript">var currLang = '';</script>
- <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
- <!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
- </head>
- <body><div class="root"><div class="vbox wb_container" id="wb_header">
- <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>
- </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>
- <div class="vbox wb_container" id="wb_main">
- <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>
- <p class="wb-stl-normal"> </p>
- <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>
- </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>
- </div><div id="wb_element_instance26" class="wb_element" style=" overflow: hidden;">
- <h5>Add Enemy to Database</h5>
- <form action="insert_enemy.php" method="post">
- <table border="1"><tr><td>Enemy name</td>
- <td><input type="text" name="name" maxlength="10"><br></td></tr><tr><td>Faction</td>
- <td><input type="text" name="faction" maxlength="10"><br></td></tr><tr><td>
- <input type="submit" value="Update Enemy List"></td></tr></table></form>
- </div><div id="wb_element_instance27" class="wb_element" style=" overflow: hidden;"><!--
- Document to connect to database, then display the entire contents
- Again, doesn't display properly because it can't connect to then
- database properly. Web service denies the request.
- Troubleshoot: I've tried to use the GRANT command, but I do not have
- the authority on the service. I tried deleting and re-declaring the database,
- and I tried to manually change the user/password - nothing worked.
- Works fine when I use localhost
- -->
- <title>Enemy List Database</title>
- <?php
- $dbServerName = "databases.000webhost.com"; //change to website URL
- $dbUsername = "id3562886_test"; //change to website database username
- $dbPassword = "testing"; //change to website database password
- $dbName = "id3562886_enemylist"; //database name, may need to change
- $conn = mysqli_connect($dbServerName, $dbUsername, $dbPassword, $dbName);
- if (!$conn)
- {
- echo "Error: Could not connect to database. Please try again.";
- die;
- }
- mysqli_select_db($dbName);
- //Statements to output entire table data
- $query = "SELECT * FROM enemies;";
- $result = mysqli_query($query);
- $resultCheck = mysqli_num_rows($result);
- echo "<p>Number of Enemies: ".$resultCheck."</p>";
- for ($i=0;i ";
- echo $row['enemyID'];
- echo $row['enemyName'];
- echo $row['enemyCity'];
- }
- ?>
- </div><div id="wb_element_instance28" class="wb_element" style="width: 100%;">
- <script type="text/javascript">
- $(function() {
- $("#wb_element_instance28").hide();
- });
- </script>
- </div></div><div class="wb_cont_outer"></div><div class="wb_cont_bg"></div></div>
- <div class="vbox wb_container" id="wb_footer">
- <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">
- $(function() {
- var footer = $(".wb_footer");
- var html = (footer.html() + "").replace(/^\s+|\s+$/g, "");
- if (!html) {
- footer.parent().remove();
- footer = $("#wb_footer, #wb_footer .wb_cont_inner");
- footer.css({height: ""});
- }
- });
- </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&utm_campaign=000_logo&utm_medium=website_atalkez&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>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement