Witam. Mam gotowy skrypt .
O to on
<?php
include("config.php");
$connect = odbc_connect
("Driver={SQL Server};Server={$host}; Database={$dbname}", $user, $pass) or
die("Can't connect the MSSQL server.");
?>
<html>
<head>
<title>LifeSro Registration</title>
<link rel="stylesheet" href="css/style2.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/stylesheet.css" type="text/css" media="screen" />
</head>
<body>
<div align="center" style="position:absolute; top:10px; z-index:0;">
</div>
<div class="reg" style="position:relative; top:222px; left:300px;">
<div style="position:relative; top:-28px; left:11px;">
<center><table width='350'>
<form action='epin.php?act=regis' method='POST'>
<tr>
<td><b><font size="5" color="white">LifeSro Registration</font></b></td><br><br>
</tr>
<tr>
</tr>
<tr>
<td width='50px'><input value='ID' type='text' name='username'></td>
</tr>
<tr>
<td width='50px'><input value='E-PIN' type='text' name='password'></td>
</tr>
<tr>
<td width='50px'><input type='submit' value='Dodaj'></td>
</tr>
</table>
</center>
<div style="position:relative; top:-30px; left:135px;">
</div>
</div>
</div>
<center>
<?php
$ip = ($_SERVER['REMOTE_ADDR']);
if (isset($_GET['act']) AND
$_GET['act'] == "regis") {
$regdate = date("Y-m-d H:i:s");
function anti_injection($sql) {
$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|'|\"|drop table|show tables|#|\*|--|\\\\)/"),"",$sql); return $sql;
}
$username=anti_injection($_POST['username']);
$password=anti_injection($_POST['password']);
if (!$_POST['username'] )
{
echo "<script>alert('Username is empty');location.href='epin.php';</script>"; }
else
if (!$_POST['password'] )
{
echo "<script>alert('E-Pin is empty');location.href='epin.php';</script>"; }
$query = odbc_exec($connect, "SELECT LifePIN FROM epin WHERE LifePIN = '$password'");
$existing_users = odbc_num_rows($query);
if($existing_users != 1) {
echo "<script>alert('Zły lub wykorzystany LifePin');location.href='epin.php';</script>"; } else
odbc_exec($connect, "INSERT INTO SK_Silk (JID, silk_own, silk_gift, silk_point) VALUES ('99999', '99999', '0', '0')");
echo "<script>alert('Account Registration Successful! \\nUsername: $username \\nPassword: $password2');location.href='$index';</script>"; }
?>
<br/>
</center>
</body>
<tr>
<td>
</td>
</tr>
</table>
</html>
jest to taki skrypt zmieniany na szybko . Ale mam jeden problem. Ponieważ chciałbym aby zrobiło mi coś takiego . SELECT JID FROM TB_User WHERE StrUserID = '$username'" i te wyciagniete JID wpisalo mi do tej tabeli SK_Silk czyli tutaj INSERT INTO SK_Silk (JID, silk_own, silk_gift, silk_point) VALUES ('TUTAJ ZAMIAST TEGO', '99999', '0', '0')")