I want to set up server for my and my friends. I set up server, cheange all ip in server and client files, and i can log in on accound that is in database already but i cant anything change in
account -> Tbl_user
also i cant register from my web to have account on database
i have this message when i want to cheange manualy in database account or write a new account:
and this is my column
and if i try to register by my web then i have this problem:
Code:
Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert explicit value for identity column in table 'USER_PROFILE' when IDENTITY_INSERT is set to OFF., SQL state 23000 in SQLExecDirect in F:\xampp\htdocs\1\reg2\register.php on line 81 Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert explicit value for identity column in table 'Tbl_user' when IDENTITY_INSERT is set to OFF., SQL state 23000 in SQLExecDirect in F:\xampp\htdocs\1\reg2\register.php on line 82
Code:
<?php
require_once "config.inc.php";
if(isset($_SESSION[step2]) && isset($_POST[step2])) {
//IáE!µÄ×îoóO»21
$errorStr = formStep3();
if($errorStr!=null){
require_once('register.html');
}else{
require_once('success.html');
$suc=$success;
unset($_SESSION[step2], $_SESSION[step1]);
}}
else {
//×c2áµÄµÚ¶?21
require_once('register.html');
$_SESSION[step2] = 1; }
//A?¶IÓA»§Iá1»µÄ±íµYµÄEý3ÝµÄ ×1E·?Ô oÍ ±L´aIá1»Eý3Ý µÄo—Eý
function formStep3(){
$errors = array();
$errorStr = null;
//2éN—ÓA»§AuEÇ·n´aÔÚ
$strSql="select * from Tbl_user where user_id='$_POST[username]'";
if ($_POST[ZoneGroup]=="zone1") {
$account_odbc = odbc_connect('account','sa','xxxxxxxxxx');
} elseif ($_POST[ZoneGroup]=="zone2") {
$account_odbc = odbc_connect('account2','sa','xxxxxxxxxx');
} else {
die ("<p><b>·ÖÇoN!Ôn´íÎó!</b></p>");
}
$user_result=odbc_do($account_odbc,$strSql);
$result_query=odbc_fetch_row($user_result);
if (odbc_result($user_result,1)!= "") $errors[] = "¸AAu3AON3*±»O1ÓAL¬ÇëÖO?ÂEäEë";
//NéÖ¤ÓA»§AuEÇ·n1a·¶
if(!preg_match("/^[0-9a-zA-Z]{6,12}$/i", $_POST[username])) $errors[]="Ö»ÄÜÓAÓcÎÄ´ó?!?´×ÖĸEý×ÖµÄ×éoI×÷ÎaÓA»§Au";
//NéÖ¤ÓA»§Au3¤¶E
if(strlen($_POST[username])<6) $errors[] = "ÓA»§AuµÄ3¤¶E2»ÄÜ?!ÓÚ6λ";
if(strlen($_POST[username])>12) $errors[]= "ÓA»§AuµÄ3¤¶E2»ÄÜ3¬1ý12λ";
//NéÖ¤AÜÂëEÇ·n1a·¶
if(!preg_match("/^[0-9a-zA-Z]{6,12}$/i", $_POST[password1])) $errors[]="Ö»ÄÜÓAÓcÎÄ´ó?!?´×ÖĸEý×ÖµÄ×éoI×÷ÎaAÜÂë";
if(preg_match("/^[0-9]{6,12}$/i",$_POST[password1])) $errors[]="2»?ÉE1ÓA´?Eý×Ö×÷ÎaAÜÂë";
//NéÖ¤ÓA»§AuoÍAÜÂëEÇ·nIaͬ
if($_POST[username]==$_POST[password1]) $errors[]= "OEoAoÍAÜÂë2»ÄÜIaͬ";
//NéÖ¤AÜÂë3¤¶E
if(strlen($_POST[password1])<6) $errors[] = "AÜÂëµÄ3¤¶E2»ÄÜ?!ÓÚ6λ";
if(strlen($_POST[password1])>12) $errors[] = "AÜÂë3¤¶E2»ÄÜ´óÓÚ12λ";
//NéÖ¤AÜÂëO»ÖÂ?Ô
if($_POST[password2]!=$_POST[password1]) $errors[] = "EäEëµÄAÜÂë2»O»ÖÂ";
//NéÖ¤OO»OAÜÂëÎEIâ´?°¸3¤¶E
if(strlen($_POST[question])>20) $errors[] = "OO»OAÜÂëÎEIâ´óÓÚ20λL¬Çë·µ»OÖO?ÂEäEë";
if(strlen($_POST[question])<10) $errors[] = "OO»OAÜÂëÎEIâ?!ÓÚ10λL¬Çë·µ»OÖO?ÂEäEë";
if(strlen($_POST[answer])>20) $errors[] = "OO»OAÜÂë´?°¸´óÓÚ20λL¬Çë·µ»OÖO?ÂEäEë";
if(strlen($_POST[answer])<10) $errors[] = "OO»OAÜÂë´?°¸?!ÓÚ10λL¬Çë·µ»OÖO?ÂEäEë";
//NéÖ¤ÓA»§emailOýE·?Ô
if(!preg_match("/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i",$_POST[mail])) $errors[]="EmailµOÖ·2»OýE·L¬ÇëÖO?ÂEäEëOýE·µÄEmailµOÖ·";
//´íÎó?AIcEä3ö
if(sizeof($errors)>0){
$errorStr .= "<br><font>";
$errorStr .= "?AIcEäEë´íÎóLo";
foreach($errors as $error)
$errorStr .= "<li>$error</li>";
$errorStr .= "</font><br><br>";
}else{
//1ÓAÜAÜÂë
$passwd_user=md5($_POST[password1]);
//»nE!user_no
$dk_time=strftime("%y%m%d%H%M%S");
list($usec1, $sec1) = explode(" ",microtime());
$dk_user_no=$dk_time.substr($usec1,2,2);
[COLOR="DarkRed"]//ÓA»§×c2áÓi3ä
$dk_account_query="insert into USER_PROFILE(user_no,user_id,user_pwd,resident_no, user_type,login_flag,login_tag,ipt_time,login_time ,logout_time,user_ip_addr,server_id) values('$dk_user_no','$_POST[username]','$_POST[password1]','801011000000','1','0','Y','01/01/2006 00:00:00',null,null,null,'000')";[/COLOR]
//ÓA»§×EÁI±L´a
$dk_account_query2="insert into Tbl_user(user_no,user_id,user_pwd,user_mail,user_a nswer,user_question) values('$dk_user_no','$_POST[username]','$_POST[password1]','$_POST[mail]','$_POST[answer]','$_POST[question]')";
//Ö´??ÓA»§×c2áoÍ×EÁI±L´aÓi3ä
$dk_account_result1=odbc_do($account_odbc,$dk_acco unt_query);
$dk_account_result2=odbc_do($account_odbc,$dk_acco unt_query2);
odbc_close($account_odbc);
}
//·µ»O´íÎóIuIcµ1O3Aa
return $errorStr;
}
?>
I read on the forum (and not only this) about me problem but most of link are death and i dont know what i do wrong
Pls helm me someone
ps. sorry for my realy bad english







