error reg page

02/07/2011 07:59 jammer1972#1
Use of undefined constant step2 - assumed 'step2' in C:\xampp\htdocs\regg\register.php on line 5
Use of undefined constant step2 - assumed 'step2' in C:\xampp\htdocs\regg\register.php on line 18


Notice: Use of undefined constant step2 - assumed 'step2' in C:\xampp\htdocs\regg\register.php on line 5

Notice: Use of undefined constant step2 - assumed 'step2' in C:\xampp\htdocs\regg\register.php on line 5

Notice: Use of undefined constant ZoneGroup - assumed 'ZoneGroup' in C:\xampp\htdocs\regg\register.php on line 27

Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'Tbl_user'., SQL state S0002 in SQLExecDirect in C:\xampp\htdocs\regg\register.php on line 34

Warning: odbc_fetch_row() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\regg\register.php on line 35

Warning: odbc_result() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\regg\register.php on line 36

Notice: Use of undefined constant username - assumed 'username' in C:\xampp\htdocs\regg\register.php on line 38

Notice: Use of undefined constant username - assumed 'username' in C:\xampp\htdocs\regg\register.php on line 40

Notice: Use of undefined constant username - assumed 'username' in C:\xampp\htdocs\regg\register.php on line 41

Notice: Use of undefined constant password1 - assumed 'password1' in C:\xampp\htdocs\regg\register.php on line 43

Notice: Use of undefined constant password1 - assumed 'password1' in C:\xampp\htdocs\regg\register.php on line 44

Notice: Use of undefined constant username - assumed 'username' in C:\xampp\htdocs\regg\register.php on line 46

Notice: Use of undefined constant password1 - assumed 'password1' in C:\xampp\htdocs\regg\register.php on line 46

Notice: Use of undefined constant password1 - assumed 'password1' in C:\xampp\htdocs\regg\register.php on line 48

Notice: Use of undefined constant password1 - assumed 'password1' in C:\xampp\htdocs\regg\register.php on line 49

Notice: Use of undefined constant password2 - assumed 'password2' in C:\xampp\htdocs\regg\register.php on line 51

Notice: Use of undefined constant password1 - assumed 'password1' in C:\xampp\htdocs\regg\register.php on line 51

Notice: Use of undefined constant question - assumed 'question' in C:\xampp\htdocs\regg\register.php on line 53

Notice: Use of undefined constant question - assumed 'question' in C:\xampp\htdocs\regg\register.php on line 54

Notice: Use of undefined constant answer - assumed 'answer' in C:\xampp\htdocs\regg\register.php on line 55

Notice: Use of undefined constant answer - assumed 'answer' in C:\xampp\htdocs\regg\register.php on line 56

Notice: Use of undefined constant mail - assumed 'mail' in C:\xampp\htdocs\regg\register.php on line 58

Notice: Use of undefined constant password1 - assumed 'password1' in C:\xampp\htdocs\regg\register.php on line 71

Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'user_profile'., SQL state S0002 in SQLExecDirect in C:\xampp\htdocs\regg\register.php on line 81

Warning: odbc_do() [function.odbc-do]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'Tbl_user'., SQL state S0002 in SQLExecDirect in C:\xampp\htdocs\regg\register.php on line 82





Notice: Undefined variable: success in C:\xampp\htdocs\regg\register.php on line 12

Notice: Use of undefined constant step2 - assumed 'step2' in C:\xampp\htdocs\regg\register.php on line 13

Notice: Use of undefined constant step1 - assumed 'step1' in C:\xampp\htdocs\regg\register.php on line 13
can any one help me with this
02/07/2011 12:50 gedimazs#2
How do you think people can help you when they don't see your whole code? How do they know what is in you 5th line or 18th and etc.
02/07/2011 15:20 ҉ THT ҉#3
Try adding quotes (") and the last 2 errors. you can read it
02/08/2011 03:59 jammer1972#4
Quote:
Originally Posted by gedimazs View Post
How do you think people can help you when they don't see your whole code? How do they know what is in you 5th line or 18th and etc.
<?php

require_once "config.inc.php";

if(isset($_SESSION[step2]) && isset($_POST[step2])) {
//提取的最后一步
$errorStr = formStep3();
if($errorStr!=null){
require_once('register.html');
}else{
require_once('success.html');
$suc=$success;
unset($_SESSION[step2], $_SESSION[step1]);
}}
else {
//注册的第二步
require_once('register.html');
$_SESSION[step2] = 1; }


//判断用户提交的表单的数据的 准确性 和 保存提交数据 的函数
function formStep3(){
$errors = array();
$errorStr = null;
//查询用户名是否存在
$strSql="select * from Tbl_user where user_id='$_POST[username]'";
if ($_POST[ZoneGroup]=="zone1") {
$account_odbc = odbc_connect('account','account','account');
} elseif ($_POST[ZoneGroup]=="zone2") {
$account_odbc = odbc_connect('account2','sa','55555');
} else {
die ("<p><b>分区选择错误!</b></p>");
}
$user_result=odbc_do($account_odbc,$strSql);
$result_query=odbc_fetch_row($user_result);
if (odbc_result($user_result,1)!= "") $errors[] = "该名称已�*被占用,请重新输入";
//验证用户名是否规范
if(!preg_match("/^[0-9a-zA-Z]{6,12}$/i", $_POST[username])) $errors[]="只能用英文大小写字母数字的组合作为用户名";
//验证用户名长度
if(strlen($_POST[username])<6) $errors[] = "用户名的长度不能小于6位";
if(strlen($_POST[username])>12) $errors[]= "用户名的长度不能超过12位";
//验证密码是否规范
if(!preg_match("/^[0-9a-zA-Z]{6,12}$/i", $_POST[password1])) $errors[]="只能用英文大小写字母数字的组合作为密码";
if(preg_match("/^[0-9]{6,12}$/i",$_POST[password1])) $errors[]="不可使用纯数字作为密码";
//验证用户名和密码是否相同
if($_POST[username]==$_POST[password1]) $errors[]= "帐号和密码不能相同";
//验证密码长度
if(strlen($_POST[password1])<6) $errors[] = "密码的长度不能小于6位";
if(strlen($_POST[password1])>12) $errors[] = "密码长度不能大于12位";
//验证密码一致性
if($_POST[password2]!=$_POST[password1]) $errors[] = "输入的密码不一致";
//验证找回密码问题答案长度
if(strlen($_POST[question])>20) $errors[] = "找回密码问题大于20位,请返回重新输入";
if(strlen($_POST[question])<10) $errors[] = "找回密码问题小于10位,请返回重新输入";
if(strlen($_POST[answer])>20) $errors[] = "找回密码答案大于20位,请返回重新输入";
if(strlen($_POST[answer])<10) $errors[] = "找回密码答案小于10位,请返回重新输入";
//验证用户email正确性
if(!preg_match("/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i",$_POST[mail])) $errors[]="Email地址不正确,请重新输入正确的Email地址";


//错误信息输出
if(sizeof($errors)>0){
$errorStr .= "<br><font>";
$errorStr .= "信息输入错误:";
foreach($errors as $error)
$errorStr .= "<li>$error</li>";
$errorStr .= "</font><br><br>";
}else{

//加密密码
$passwd_user=md5($_POST[password1]);
//获取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);
//用户注册语句
$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]','$passwd_user','801011000000','1','0','Y','01/01/2006 00:00:00',null,null,null,'000')";
//用户资料保存
$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]')";
//执行用户注册和资料保存语句
$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);



}
//返回错误消息到页面
return $errorStr;
}

?>
ok here it is
02/08/2011 05:59 *[F]rea[K]*#5
try this script
[Only registered and activated users can see links. Click Here To Register...]
02/08/2011 06:46 jammer1972#6
Quote:
Originally Posted by *[F]rea[K]* View Post
try this script
[Only registered and activated users can see links. Click Here To Register...]
this is what i get when i try that one

Notice: Undefined index: activ in C:\xampp\htdocs\register.php on line 21

Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\register.php on line 80
02/08/2011 08:03 gedimazs#7
Quote:
Originally Posted by jammer1972 View Post
this is what i get when i try that one

Notice: Undefined index: activ in C:\xampp\htdocs\register.php on line 21

Fatal error: Call to undefined function mssql_connect() in C:\xampp\htdocs\register.php on line 80
have you filled this part
Code:
// fill in your mssql info here
$mssql = array(
		'host' => "localhost",
		'user' => "sa",
		'pass' => "server"
with you connect to DB info?
02/09/2011 02:18 jammer1972#8
Quote:
Originally Posted by gedimazs View Post
have you filled this part
Code:
// fill in your mssql info here
$mssql = array(
		'host' => "localhost",
		'user' => "sa",
		'pass' => "server"
with you connect to DB info?
yes i have lol i just cant get it to work
02/09/2011 08:32 gedimazs#9
this reg page uses ODBC connections. Have you linked you account.dbo with your ODBC?
02/09/2011 17:55 ҉ THT ҉#10
$account_odbc = odbc_connect('account2','sa','55555');

Is that correct?
02/09/2011 22:17 jammer1972#11
Quote:
Originally Posted by ҉ THT ҉ View Post
$account_odbc = odbc_connect('account2','sa','55555');

Is that correct?
i didnt leave rifght password here
02/10/2011 02:08 ҉ THT ҉#12
No,, I mean did you fill that in(with the right information) on your webserver?