Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost"; // Host name
- $username=""; // Mysql username
- $password=""; // Mysql password
- $db_name=""; // Database name
- $tbl_name="";
- ?>
- <html>
- <head>
- <?php include("head.php"); ?>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
- <title>Arcanum - TERA Database</title>
- </head>
- <body>
- <div id="page-wrap-3">
- <p>
- <?php
- //initilize PHP
- if ( isset ( $_POST['submit'] ) ) //If submit is hit
- {
- //then connect as user
- //change username and password to your mySQL username and password
- mysql_connect("localhost","","");
- //if you wish to connect to a local MySQL database the code is mysql_connect("localhost","root",""); until you set a username and password
- //select which database you want to edit
- mysql_select_db("")or die( "<p><span style=\"color: red;\">Unable to select database</span></p>");
- //convert all the posts to variables:
- $name = mysql_real_escape_string(htmlspecialchars($_POST['name']));
- $category = $_POST['category'];
- $subcategory = $_POST['subcategory'];
- $class_id = $_POST['class_id'];
- $level = $_POST['level'];
- $bind = $_POST['bind'];
- $tier = $_POST['tier'];
- $trade = $_POST['trade'];
- $ilvl = $_POST['ilvl'];
- $amod = $_POST['amod'];
- $xdmg = $_POST['xdmg'];
- $dmod = $_POST['dmod'];
- $bal = $_POST['bal'];
- $description = mysql_real_escape_string(htmlspecialchars($_POST['description']));
- $description2 = mysql_real_escape_string(htmlspecialchars($_POST['description2']));
- $description3 = mysql_real_escape_string(htmlspecialchars($_POST['description3']));
- $sprice = $_POST['sprice'];
- $bprice = $_POST['bprice'];
- $percent = $_POST['percent'];
- $source = mysql_real_escape_string(htmlspecialchars($_POST['source']));
- $tnail = @$_POST['thumbnail'];
- //Insert the values into the correct database with the right fields
- $result = mysql_query("INSERT INTO `{$tbl_name}` VALUES ('NULL','NULL','{$name}', '{$category}', '{$subcategory}', '{$class_id}', '{$level}', '{$bind}', '{$tier}', '{$trade}', '{$ilvl}', '{$amod}', '{$xdmg}', '{$dmod}', '{$bal}', '{$description}', '{$description2}', '{$description3}', '{$sprice}', '{$bprice}', '{$percent}','{$source}', 'misc.png', '0')") or die(mysql_error());
- mysql_close();
- //confirm
- echo "<p><span style=\"color: red;\">Thank You; your comments have been entered in my database. DO NOT REFRESH THE PAGE or data will be sent again.</span></p>";
- }
- else
- {
- // close php so we can put in our code
- ?>
- <?php
- } //close the else statement
- ?>
Add Comment
Please, Sign In to add comment