Author Topic: PHP on Thank You Pages (html Pages with code)  (Read 2689 times)

cwboaze

  • Posts: 37
    • View Profile
PHP on Thank You Pages (html Pages with code)
« on: June 25, 2004, 10:27:19 am »
Hi Dean,

My question regards the html code for your thank you pages and error pages.

Can I insert php commands and insert into this page. like having it insert their information into another database somewhere else on my server for other purposes.

for example:

They signup for my new program and on the thank you page it can display the information they input. ok. i need it to let that information be submitted to another database on this server. Letting me email them from another location for another reason.

Can I insert php into my thank you pages. ???????
if not that would be a great addon to make that possible.

Thanks,
CB

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
PHP on Thank You Pages (html Pages with code)
« Reply #1 on: June 25, 2004, 03:11:58 pm »
What you can do is copy the "signup-xtra.php" file, included in the ZIP in the "xtra" folder, to your main ListMail folder.

When copied to the main folder this script will run after every signup and, optionally via checkbox, after manual additions to your list.

In this file you can make a new database connection, etc.  You'll want to make sure the commands only work during a signup to a certain list with code such as follows:

Code: [Select]
// run only if subscribing to list 2
if($list=='2'){
 $link2=mysql_connect('lmhost','lmuser','lmpass');
 mysql_select_db('lmdatabase');

 // create a unique ID..
 $uniq = '';
 while(!$uniq){
  if($randmaxx) $randmax = $randmaxx;
  $uniq_str = strtolower(substr(md5(rand(0,$randmax)), 0,7));
  $ucmd = "select id from lm_users where uid = '$uniq_str'";
  $urow = mysql_query($ucmd,$link2);
  if(@mysql_num_rows($urow)==0) $uniq=1;
 }
 // insert the user with all the same data as the user signed up with (provided to signup-xtra.php automatically by ListMail)
 mysql_query("insert into lm_users (fname,lname,email,dateadd,uid,refurl,ipaddr,cnf) values('$fname','$lname','$email','$today','$uniq_str','$refurl','$ipaddr','1')",$link2);
}
// all done


Note, do not use the "exit()" function after your code, you must simply restrict the operation on a per-list basis by using an IF statement.
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

cwboaze

  • Posts: 37
    • View Profile
Re:
« Reply #2 on: June 25, 2004, 05:46:53 pm »
Hi,

Looks good. I will try this and see how it works and makes some edits to make it work a certain way with our servers.

Thanks,
CB