<?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("Driver={SQL Server};DSN=".$dsn.";Server=".$db_host.";Database=".$db_name,$db_user,$db_pwd);
} elseif ($_POST[ZoneGroup]=="zone2") {
$account_odbc = odbc_connect("Driver={SQL Server};DSN=".$dsn.";Server=".$db_host.";Database=".$db_names,$db_user,$db_pwd);
} else {
die ("<p><b>·ÖÇøÑ¡Ôñ´íÎó!</b></p>");
}
$user_array=odbc_do($account_odbc,$strSql);
$array_query=odbc_fetch_row($user_array);
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룬Çë·µ»ØÖØÐÂÊäÈë";
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]);
$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_answer,user_question) values('$dk_user_no','$_POST[username]','$_POST[password1]','$_POST[mail]','$_POST[answer]','$_POST[question]')";
$dk_account_result1=odbc_do($account_odbc,$dk_account_query);
$dk_account_result2=odbc_do($account_odbc,$dk_account_query2);
odbc_close($account_odbc);
}
return $errorStr;
}
?>
<?php
//¿ªÊ¼session
session_start();
//ÉèÖò»½øÐб¾µØ»º´æ
header('Expires: '.date('D,d M Y H:i:s',mktime(0,0,0,1,1,2000)).' GMT');
header('Last-Modified:'.gmdate('D,d M Y H:i:s').' GMT');
header('Cache-control: private, no-cache,must-revalidate');
header('Pragma: no-cache');
$db_name="account";
$db_names="account2";
$db_host="myhost";
$db_user="user";
$db_pwd="pass";
$dsn = "DRIVER={SQL Server};" .
"CommLinks=tcpip(Host=$db_host);" .
"DatabaseName=$db_name;" .
"uid=$db_user; pwd=$db_pwd";
?>
$account_odbc = odbc_connect("Driver={SQL Server};DSN=".$dsn.";Server=".$db_host.";Database=".$db_name,$db_user,$db_pwd);
I thought that the case in prifix tables .... rewrote ... made "Tbl_" prifix but he still complained = (Quote:
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 W:\home\localhost\subdomain\register.php on line 32
Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in W:\home\localhost\subdomain\register.php on line 33
Warning: odbc_result(): supplied argument is not a valid ODBC result resource in W:\home\localhost\subdomain\register.php on line 34
I have the same problem. Do you have a router, firewall, anti-virus, etc etc...Quote:
now i have fix my Problem with the Server and all work, but when i want connect:
[Only registered and activated users can see links. Click Here To Register...]
You can unpack the pack.d0x files. Its possible, go back to the 2moons / Dekaron section, select the 2moons link. Not the PServer one. Search for unpackers. There are a few programs that'll allow you to do this. 2moons Expedition is quite different from 2moons: Bad Moon Rising. Instead of having one data.pak, they have 5. pack.d00, pack.d01, pack.d02, pack.03, pack.d04. Each one is specific. You have to unpack all of them.Quote:
Tell me please ...
Is it possible to unpack the *. pak file in 2MOONSExpedition?
How come the server to the client Expedition?
If not, please tell me what the customer / client is better to use? and, if possible, a direct link =)
3 days downloads will))
The problem is that you and the server and client run on a single computer =)Quote:
masterP
Thank you, but you can give an accurate reference, simply do not want to be mistaken, because I ride a client entire 3 days =)Quote:
Krunky
Download pictures to another place, I will not show =(Quote:
MrRight
heya... the first thing you removed was the connection method to the database.Quote:
register.php
config.phpCode:<?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("Driver={SQL Server};DSN=".$dsn.";Server=".$db_host.";Database=".$db_name,$db_user,$db_pwd); } elseif ($_POST[ZoneGroup]=="zone2") { $account_odbc = odbc_connect("Driver={SQL Server};DSN=".$dsn.";Server=".$db_host.";Database=".$db_names,$db_user,$db_pwd); } else { die ("<p><b>·ÖÇøÑ¡Ôñ´íÎó!</b></p>"); } $user_array=odbc_do($account_odbc,$strSql); $array_query=odbc_fetch_row($user_array); 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룬Çë·µ»ØÖØÐÂÊäÈë"; 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]); $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_answer,user_question) values('$dk_user_no','$_POST[username]','$_POST[password1]','$_POST[mail]','$_POST[answer]','$_POST[question]')"; $dk_account_result1=odbc_do($account_odbc,$dk_account_query); $dk_account_result2=odbc_do($account_odbc,$dk_account_query2); odbc_close($account_odbc); } return $errorStr; } ?>
Previously, complained that he could not find a server and connect to it .. I rewrote the connection ...Code:<?php //¿ªÊ¼session session_start(); //ÉèÖò»½øÐб¾µØ»º´æ header('Expires: '.date('D,d M Y H:i:s',mktime(0,0,0,1,1,2000)).' GMT'); header('Last-Modified:'.gmdate('D,d M Y H:i:s').' GMT'); header('Cache-control: private, no-cache,must-revalidate'); header('Pragma: no-cache'); $db_name="account"; $db_names="account2"; $db_host="myhost"; $db_user="user"; $db_pwd="pass"; $dsn = "DRIVER={SQL Server};" . "CommLinks=tcpip(Host=$db_host);" . "DatabaseName=$db_name;" . "uid=$db_user; pwd=$db_pwd"; ?>
But now here gives this errorCode:$account_odbc = odbc_connect("Driver={SQL Server};DSN=".$dsn.";Server=".$db_host.";Database=".$db_name,$db_user,$db_pwd);
I thought that the case in prifix tables .... rewrote ... made "Tbl_" prifix but he still complained = (
Tried to do "odbc_exec ()" is still complaining about ..... 12 hours I can not understand =((((((((
PS
Table Tbl_user is in the database account ....
Just only yesterday found MsSQL)))
Let's finish the site, never mind at the beginning of the road ..
Please =)
Sorry my bad english =)
here you are:Quote:
Download pictures to another place, I will not show =(
Quote:
heya... the first thing you removed was the connection method to the database.
the second one was the table where the registration process writes the account information down!
you MUST keep it like i posted it!
i said, don't forget to lonk a ODBC system-DSN to your account database. use your best friend google, and you will get some tutorials how it should be done.
here's one tutorial: [Only registered and activated users can see links. Click Here To Register...]
@mysticzero
the lan-ips also work.
the standard "192.168.5.007" was the lan-ip of my test-server ;)
You won't need DNS. You need to explain a little better of what your problem is. Are you trying to host the registration page?Quote:
Does not work = (
Installed DNS, running SQL Manager for server 192.168.0.128 - (my local IP)
And then, as always error
Maybe in the code that you can not then? I do not want to do that? = (
[Only registered and activated users can see links. Click Here To Register...]
You will need to tell the client to look for the new skills. I can't baby you through this.Quote:
must i download the client to if i want to have the new skills?
Like I said above, you need to tell the client to Look / load the information. I can't help you with this, hence I'm too busy with tutorial writing, homework, and my own server.Quote:
got the new skils now what do i do with them?