This topic is locked
[SOLVED]

 registration page event

11/10/2014 2:39:33 AM
PHPRunner General questions
D
droogers author

Hello,
in my registration page I will use the after succesfull registration event:

global $conn;

$postcode=$values['postcode'];

$number=$values['nr'];

$postcode_id=substr($postcode, 0, 4);

$postcode_id.=ord(substr($postcode, 4, 1));

$postcode_id.=ord(substr($postcode, 5, 1));

$str = "SELECT * FROM postcode WHERE postcode_id=$postcode_id AND (minnumber <= $number AND maxnumber >= $number)";

$rs = db_query($str,$conn);

$data = db_fetch_array($rs);

$values['straat'] = $data["street"];

$values['woonplaats']=$data["city"];
// Place event code here.

// Use "Add Action" button to add code snippets.
return true;


This code works good on the list page. But on the registration page it didn't work. $values didn't recognize the field.

Sergey Kornilov admin 11/10/2014

If you check AfterSuccessfulRegistration event documentation you will find that no $values array is available there but you need to use $userdata array instead:

http://xlinesoft.com/phprunner/docs/after_successful_registration.htm