function auth_token_store($scope, $data) { $token = auth_random_token(); $ser = ''; rabx_wire_wr($data, $ser); db_query(' insert into token (scope, token, data, created) values (?, ?, ?, ms_current_timestamp())', array($scope, $token, $ser)); return $token; }
<i>Example: "OX1 3DR" </form> <?php } } pw_footer(); exit; } if (user_isloggedin()) { header("Location: /account/settings.php\n"); exit; } $title = "Subscribe to Newsletter"; $ok = false; if ($submit) { $token = auth_random_token(); if (!pw_validate_email($email)) { $feedback = 'Please enter a valid email address'; } else { $db->query("DELETE FROM pw_dyn_newsletter WHERE email='{$email}'"); $query = "INSERT INTO pw_dyn_newsletter\n (email, token, confirm, subscribed) VALUES ('{$email}', '{$token}', 0, now())"; $db->query($query); $message = "Follow this link to confirm your subscription: " . "\n\nhttp://www.publicwhip.org.uk/N/" . urlencode($token) . "\n\nYou will then receive the Public Whip newsletter," . "\nwhich is at most monthly."; mail($email, 'Confirm your subscripton to the Public Whip newsletter', $message, 'From: Public Whip <*****@*****.**>'); $ok = true; $title = "Now check your email!"; $feedback = 'Please click on the link in the email we have just sent you to complete your subscription.'; } } $onload = "givefocus('email')";