J
|
Jane 2/7/2007 |
You can do it using Before record added event on the Events tab. |
I
|
ictaylor author 2/7/2007 |
Ok, the following code is suggested: function BeforeRegister($userdata)
|
![]() |
Alexey admin 2/7/2007 |
Hi, global $conn,$message;
|
I
|
ictaylor author 2/8/2007 |
Hi function BeforeRegister($userdata)
Parse error: parse error, unexpected $ in /home/b/o/boxedclever_net/users/entry/include/events.php on line 29 |
J
|
Jane 2/8/2007 |
It seems that you've forgot } to close BeforeRegister function: function BeforeRegister($userdata) { // Parameters: // $userdata - Array. // Each field on this form represented as 'Field name'-'Field value' pair //** Check if specific record exists **** global $conn,$message; $strSQLExists = "select * from _users where Username='".$values["Username"]."' and Password='".$values["Password"]."'"; $rsExists = db_query($strSQLExists,$conn); $data=db_fetch_array($rsExists); if($data) { return true; } else { $message="username and password not exist"; return false; } } |
I
|
ictaylor author 2/8/2007 |
still doesnt work PHP error happened Technical information Error type 8 Error description Undefined variable: values URL www.boxedclever.net/users/entry/register.php? Error file /home/b/o/boxedclever_net/users/entry/include/events.php Error line 13 SQL query select count(*) from `_enter` where `Site Username`='boxedclever' |
J
|
Jane 2/9/2007 |
On the BeforeRegster event you need to use $userdata variable instead of $values: $strSQLExists = "select * from _users where Username='".[b]$userdata["Username"][/b]."' and Password='".$userdata["Password"]."'"; |
I
|
ictaylor author 2/9/2007 |
Ok function BeforeRegister($userdata) |
I
|
ictaylor author 2/9/2007 |
FIXED IT finally!! function BeforeRegister($userdata) |