
Originally Posted by
bokehman
Just send the password immediately and tell them in the same email the account will be activated once the payment can be confirmed. (This wouldn't be necessary if you were using a proper payment service). Then all you need is a flag in your main table that states whether or not the account is active.
So something like
PHP Code:
CREATE TABLE `user` (
`userid` int(11) NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`password` varchar(255) NOT NULL default '',
`active` smallint(7) NOT NULL default '0',
`salt` varchar(255) NOT NULL default ''
) ;
And then set active to 1 when they pay?
And since I feel adventurous:
PHP Code:
<html>
<body>
<?php
if ($_POST['paid']) {
$paid = intval($_POST['paid']);
$sql = ("UPDATE `user` SET `active` = '$paid' WHERE `userid` = '$setvar'");
echo "User updated";
}
?>
<form action=<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<select name="paid">
<option value="1">Active</option>
<option value="2">Inactive</option>
</select>
</form>
</body>
</html>
Bookmarks