|
You last visited: Today at 04:08
Advertisement
Php Register Script
Discussion on Php Register Script within the Dekaron Private Server forum part of the Dekaron category.
05/19/2014, 18:25
|
#1
|
elite*gold: 0
Join Date: May 2014
Posts: 21
Received Thanks: 0
|
Php Register Script
Hello,
I got a little Problem.
If I run my register script than the USER_PROFILE table crashes with timeout:
Here is my php code:
PHP Code:
$plist = mssql_query("INSERT INTO USER_PROFILE (user_id) VALUES ('".$data["Username"]."')");
$data is an array with alle POST Data from the register form
But if I print my query and use it at the server query console, it works.
Any idea?
|
|
|
05/19/2014, 19:22
|
#2
|
elite*gold: 0
Join Date: Mar 2013
Posts: 294
Received Thanks: 91
|
I think is your databases try use different ones
|
|
|
05/19/2014, 19:26
|
#3
|
elite*gold: 0
Join Date: May 2014
Posts: 21
Received Thanks: 0
|
Why the databases? ^^ I think its a config problem..^^
|
|
|
05/19/2014, 22:51
|
#4
|
elite*gold: 0
Join Date: Mar 2009
Posts: 236
Received Thanks: 130
|
with one piece of php code we can't solve your issue. please put your whole code up.
|
|
|
05/19/2014, 23:05
|
#5
|
elite*gold: 0
Join Date: May 2014
Posts: 21
Received Thanks: 0
|
What you wanne see? There's only the connection
PHP Code:
GLOBALS["DB"] = mssql_pconnect($Server, $User, $Pass);
and the query:
PHP Code:
$msdb = mssql_select_db("account", $GLOBALS["DB"]); $plist = mssql_query("INSERT INTO USER_PROFILE (user_id, user_pwd) VALUES ('".$data["Username"]."', '".md5($data["Passwort"])."');");
I have checked the data array with var_dump = all ok
Tried some different querys ..but no way :/
But localy, it works.
|
|
|
05/19/2014, 23:14
|
#6
|
elite*gold: 0
Join Date: Mar 2013
Posts: 294
Received Thanks: 91
|
Dark will give u my register.php it works 100% tested by me and its the register i use .
If this register no work try to do the next :
- Retry add Queryz the problem can be there too
- Go in Php folder > php.ini > enable mssql ( see on janvier123 video ) its only delete the ; before all frase of mssql
- Create new ODBC Connection but with this register no need
Download in spoiler
|
|
|
05/19/2014, 23:21
|
#7
|
elite*gold: 0
Join Date: May 2014
Posts: 21
Received Thanks: 0
|
Quote:
Originally Posted by jaskile12
Dark will give u my register.php it works 100% tested by me and its the register i use .
If this register no work try to do the next :
- Retry add Queryz the problem can be there too
- Go in Php folder > php.ini > enable mssql ( see on janvier123 video ) its only delete the ; before all frase of mssql
- Create new ODBC Connection but with this register no need
Download in spoiler
|
same as before... I think the problem is the config...(sql server) but dont know where
|
|
|
05/20/2014, 05:43
|
#8
|
elite*gold: 0
Join Date: Oct 2012
Posts: 96
Received Thanks: 5
|
Do you have a database named db? or see if the account from the ODBC see if its pass is correct
|
|
|
05/20/2014, 06:47
|
#9
|
elite*gold: 0
Join Date: May 2014
Posts: 21
Received Thanks: 0
|
no database named db and connection is ok. I can do SELECT's but no INSERT <.<
But if I try with query analyzer:
It works
But if use my php code like that:
PHP Code:
$plist = mssql_query("INSERT INTO [USER_PROFILE] VALUES(1)");
it goes timeout:
|
|
|
05/20/2014, 07:52
|
#10
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,853
Received Thanks: 1,876
|
Clearly one of you dont understand how MSSQL tables work, some columns cannot be NULL
Quote:
Cannot insert the value NULL into column 'user_no', table 'account.dbo.USER_PROFILE'; column does not allow nulls. INSERT fails.
The statement has been terminated.
|
PHP Code:
$dk_time = strftime("%y%m%d%H%M%S"); $regdate = strftime("%y%m%d"); list($usec1, $sec1) = explode(" ",microtime()); $dk_user_no = $dk_time.substr($usec1, 2, 2); $pass = md5($_POST['account_password']); $query1 = $db->SQLquery("INSERT INTO account.dbo.USER_PROFILE (user_no,user_id,user_pwd,resident_no,user_type,login_flag,login_tag,server_id) VALUES ('".$dk_user_no."','".$_POST['account_name']."','".$pass."','801011000000','1','0','Y','000')");
Fill in every single value!
|
|
|
05/20/2014, 15:12
|
#11
|
elite*gold: 0
Join Date: May 2014
Posts: 21
Received Thanks: 0
|
@janvier123
PHP Code:
Warning: mssql_query(): message: Cannot insert explicit value for identity column in table 'USER_PROFILE' when IDENTITY_INSERT is set to OFF. (severity 16) in /var/www/XXXX/Application/Classes/Model/Account/Account.php on line 323 Warning: mssql_query(): General SQL Server error: Check messages from the SQL Server (severity 16) in /var/www/XXXXX/Application/Classes/Model/Account/Account.php on line 323 Warning: mssql_query(): Query failed in /var/www/XXXXXX/Application/Classes/Model/Account/Account.php on line 323
|
|
|
05/20/2014, 19:36
|
#12
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,853
Received Thanks: 1,876
|
|
|
|
05/21/2014, 07:33
|
#13
|
elite*gold: 0
Join Date: May 2014
Posts: 21
Received Thanks: 0
|
same as before...can I use an other function to connect ?
|
|
|
05/21/2014, 09:53
|
#14
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,853
Received Thanks: 1,876
|
iam not going to spoon feed you everytime!
PHP Code:
CREATE TABLE dbo.USER_PROFILE ( user_no varchar(14), user_id varchar(20) NOT NULL, user_pwd varchar(32), resident_no varchar(13), user_type varchar(3) CONSTRAINT DF__user_prof__user___267ABA7A DEFAULT '1', login_flag int CONSTRAINT DF__user_prof__statu__276EDEB3 DEFAULT 0, login_tag char CONSTRAINT DF_user_profile_login_tag DEFAULT 'Y', ipt_time datetime, login_time datetime, logout_time datetime, user_ip_addr varbinary(4), server_id varchar(3) CONSTRAINT DF__user_prof__serve__0D7A0286 DEFAULT '000', user_mail varchar(50) NOT NULL DEFAULT 0, /* Keys */ CONSTRAINT PK_USER_PROFILE PRIMARY KEY (user_no) WITH FILLFACTOR = 90 ) ON FG_MST0 GO CREATE UNIQUE INDEX IDX_USER_ID ON dbo.USER_PROFILE (user_id) WITH FILLFACTOR = 85 GO
|
|
|
05/21/2014, 10:14
|
#15
|
elite*gold: 0
Join Date: May 2014
Posts: 21
Received Thanks: 0
|
Quote:
Originally Posted by janvier123
iam not going to spoon feed you everytime!
PHP Code:
CREATE TABLE dbo.USER_PROFILE ( user_no varchar(14), user_id varchar(20) NOT NULL, user_pwd varchar(32), resident_no varchar(13), user_type varchar(3) CONSTRAINT DF__user_prof__user___267ABA7A DEFAULT '1', login_flag int CONSTRAINT DF__user_prof__statu__276EDEB3 DEFAULT 0, login_tag char CONSTRAINT DF_user_profile_login_tag DEFAULT 'Y', ipt_time datetime, login_time datetime, logout_time datetime, user_ip_addr varbinary(4), server_id varchar(3) CONSTRAINT DF__user_prof__serve__0D7A0286 DEFAULT '000', user_mail varchar(50) NOT NULL DEFAULT 0, /* Keys */ CONSTRAINT PK_USER_PROFILE PRIMARY KEY (user_no) WITH FILLFACTOR = 90 ) ON FG_MST0 GO
CREATE UNIQUE INDEX IDX_USER_ID ON dbo.USER_PROFILE (user_id) WITH FILLFACTOR = 85 GO
|
same ...
and yea I changed to pdo, got no erros in the frontend...but no changes in table. This is so fucked up<.<
edit: I found a little crazy thing.
If I insert something with pdo and do a select on that table right after that...I get alle entrys with the new one. But the server dont save's it oO wth
|
|
|
Similar Threads
|
Fiesta Register Script V2.0 - OdinRegister Script
02/18/2013 - Fiesta Online - 6 Replies
Hey,
hab das alte Fiesta Register Script V1.1 wiedergefunden und hab mir gedacht ich schreibs mal passend für JokerServer die mit OdinFiles laufen um.
Das einzige was ihr machen müsst ist die index.php mit euren SQL Daten zu füttern, ihr könnt diese mit einfachen TextEditor programmen wie notepad.exe (Editor) oder wordpad öffnen.
EDIT1: da war n kleiner fehler der bei über 10 Accs immer alles mit nEMID 2 erstellt hat, fixed. Neue version im Anhang.
|
V14 Register Script für Gms [Homepage Script]
05/21/2011 - Flyff Private Server - 10 Replies
Naja, Meine frage wär wie man nen V14 Register Page macht wo man wenn man registriert sofort Gm ist =D.
PS: für ein ein Test Server ;3
Trafalgar†Law ~
|
All times are GMT +2. The time now is 04:08.
|
|