topical media & game development
basic-php-14-user-transact.php / php
<?php
require('config.php');
require('class.SimpleMail.php');
conn);
_REQUEST['action'])) {
switch (sql = "SELECT user_id FROM ml_users " .
"WHERE email='" . result = mysql_query(conn);
if (mysql_num_rows(row = mysql_fetch_array(user_id = url = "http://" . _SERVER['PHP_SELF']) .
"/remove.php?u=" . _POST['ml_id'];
header("Location: redirect = 'user.php';
break;
case 'Subscribe':
_POST['email'] . "'";
sql, result)) {
_POST['firstname'] . "'," .
"'" . _POST['email'] . "')";
sql, user_id = mysql_insert_id(row = mysql_fetch_array(user_id = sql = "INSERT INTO ml_subscriptions (user_id,ml_id) " .
"VALUES ('" . _POST['ml_id'] . "')";
mysql_query(conn);
_POST['ml_id'];
sql, row = mysql_fetch_array(listname = url = "http://" . _SERVER['PHP_SELF']) .
"/user_transact.php?u=" . _POST['ml_id'] . "&action=confirm";
body = "Hello " . listname . " mailing list.\n\n" .
"If you did not subscribe, please accept our " .
"apologies. You will not be subscribed if you do " .
"not visit the confirmation URL.\n\n" .
"If you subscribed, please confirm this by visiting " .
"the following URL:\n" . mailmsg = new SimpleMail();
_POST['email'],body,redirect = "thanks.php?u=" . _POST['ml_id'] . "&t=s";
break;
case 'confirm':
if (isset(_GET['ml'])) {
_GET['u'] .
" AND ml_id=" . sql, sql = "SELECT listname FROM ml_lists " .
"WHERE ml_id=" . result = mysql_query(conn);
result);
row['listname'];
_GET['u'] . "'";
sql, row = mysql_fetch_array(firstname = email = url = "http://" . _SERVER['PHP_SELF']) .
"/remove.php?u=" . _GET['ml'];
body = "Hello " . listname . " mailing list. Welcome!\n\n" .
"If you did not subscribe, please accept our " .
"apologies.\n".
"You can remove this subscription immediately by ".
"visiting the following URL:\n" . mailmsg = new SimpleMail();
email,body,redirect = "thanks.php?u=" . _GET['ml'] . "&t=s";
} else {
redirect = 'user.php';
}
}
header('Location: ' .
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.