Want to achieve something. Help needed!

0 replies
Hi, i am not quite sure how to put this or even if it is possible. I created a wp site where i have a page called Register. Now i have a config.php file and a index.php file where you will register to a certain database. How can i integrate those files into wordpress?

This is the config.php and index.php

Code:
<?php 
	/*
	|-------------------------------------------------------------------
	| Datenbank Connection Details
	|-------------------------------------------------------------------
	*/
		$mysql_host 	= "5.100.192.23";
		$mysql_user 	= "root";
		$mysql_pass 	= "654321";
		$mysql_db	= "account";
	/*
	|-------------------------------------------------------------------
	| Datenbank Verbindung herstellen
	|-------------------------------------------------------------------
	*/	
		mysql_connect($mysql_host, $mysql_user, $mysql_pass) OR
		die("Can't connect to database.<br /> Error: ".mysql_error());	
		
		mysql_select_db($mysql_db) OR
		die("Database can't be used.<br /> Error: ".mysql_error());
?>
Code:
<?php 
	include('config.php');
	if(isset($_POST['submit']) && $_POST['submit'] == 'Register') {
		$username = mysql_real_escape_string($_POST['username']);
		$password = mysql_real_escape_string($_POST['password']);
		$rl_name = mysql_real_escape_string($_POST['rl_name']);
		$email = mysql_real_escape_string($_POST['email']);
		
		$sql = "INSERT INTO account SET login = '".$username."', password = PASSWORD('".$password."'), real_name = '".$rl_name."', email = '".$email."'";
		$result = mysql_query($sql);
		if($result) { echo 'EEE ASTA E FRATE MERGE CONTU :D :D :D :D :D go...'; } else { echo 'NOT'; }
	}
?>
<head>
<title>Registration</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="Registration" />
<meta name="keywords" content="some, keywords, comes, later" />
<meta name="language" content="en" />
<meta name="robots" content="index,follow" />
<meta name="author" content="S3cr3t" />
<meta name="revisit-After" content="5 days" />
<meta name="distribution" content="local" />
<style type="text/css">
<!--
body 		{ background:#000;	color:#FF0; font:bold 8pt Verdana,Arial,Helvetica,sans-serif; }
#container	{ margin:40px auto; width:750px; overflow:hidden; }
#text 		{ padding:5px; }
#text ul 	{ padding:0px; margin-left:15px; }
#text li 	{ display:block; }
#left 		{ float:left; }
#right 		{ float:right; margin-right:15px; }
!.style1 {color: #00FF00}
.style1 {color: #00FF00}
-->
</style>
<script type="text/javascript">
if (top.frames.length != 0)
	top.location=self.location;
</script>
</head>
<body>
	<div class="style1" id="container">
		<div id="text">
			<form action="index.php" method="post">
				<ul>
					<li>Username:</li>
					<li><input type="text" name="username" size="60" /></li>
					<li>&nbsp;</li>
					<li>Password:</li>
					<li><input type="password" name="password" size="60" /></li>
					<li>&nbsp;</li>
                    <li>Password Again:</li>
					<li><input type="password" name="password" size="60" /></li>
					<li>&nbsp;</li>
					<li><input type="submit" name="submit" value="Register" /></li>
				</ul>
			</form>
		</div>
	</div>
	<h1><a href="../index.html">&lt;&lt;Home </a></h1>
</body>
</html>

Anyone can help?
Thanks
#achieve #needed

Trending Topics