ListMailPRO Email Marketing Software Forums
ListMailPRO Email Marketing Software Forums => General Help & How-To => Topic started by: mike2 on January 19, 2006, 08:26:10 am
-
Ok, I searched for something similar but couldn't find it, even though I'm sure I saw something like this before.
What I want to do is when someone places and order from my site I want to:
1) Check if there email exists on list 2 (confirmed or not), if so, simply move them to list 1, with a seq of 99 (so they don't get that lists followups) and change to confirmed.
2) If they aren't on list 2 or on list 1, add there email to list 1 with a seq of 99.
3) If they are on list 1 already, change there seq to 99 and confirmed (if not already).
If you could help with the PHP code to accomplish this, I'd throw it in at the end of my order system, thanks a ton!
-
Bump > any thing on this?
-
Mike,
Sorry I've been really busy. Let's see...
How about this...
// relative path to LMP
$path_to_lmp = '../';
include($path_to_lmp.'config.php');
include($path_to_lmp.'admin.php');
mysql_query("update $utable set list = '1', cnf = '1', cseq = '99' where list = '2' and email like '".addslashes($email)."';");
$aff = mysql_affected_rows();
if($aff==0){
// insert the user to list 1
// See: http://listmailpro.com/forum/index.php?topic=172.0 for LMinsert.php script
include($path_to_lmp.'LMinsert.php');
LMinsert('1',$email,'','','','','','','','','','','','','99');
}
Note that you'll need to re-specify your MySQL access info in LMinsert.php, which takes care of the heavy work such as dupe checking and unique id creation.
Regards, DW