1. // confirmation sent
  2. if (isset($cfg['returnto_conf']) && $cfg['returnto_conf'] != '') {
  3. header('Location: '.$cfg['returnto_conf']);
  4. }
  5. else {
  6. printf($cfg['template'], 'KLIKNIJ ABY ZATWIERDZIC', 'http://www.club-acme.pl/txtlist/?type=confirm&email='.$addr.' ');
  7. }
  8. }
  9. else {


Chciałbym zrobić z tego link (http://www... )

caly plik index.php

  1. <?
  2. require('config.inc.php');
  3. require('functions.inc.php');
  4.  
  5. // Max execution time of script. This does not include sleep time, so only restricts time
  6. // allowed for mailing.
  7.  
  8. $type = $_GET['type'];
  9. $addr = stripslashes(urldecode($_GET['email']));
  10.  
  11. if ($type == 'sub') {
  12. // subscribe address. Actually, all it does is send the confirmation email
  13. if (!preg_match('#^([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+[^\".,?! ])$#i', $addr)) {
  14. $err = 'Your email address appears to be invalid.';
  15. }
  16. if (!isset($err)) {
  17. $f = openfile($cfg['listfile']);
  18. $exists = false;
  19. while ($item = readitem($f)) {
  20. if ($item['addr'] == $addr) {$exists = true;break;}
  21. }
  22. if ($exists) {
  23. $err = 'That address is already subscribed to the list.';
  24. }
  25. }
  26. if (!isset($err)) {
  27. // send confirmation email
  28. $headers = 'From: '.$cfg['from'];
  29. if ($cfg['headers']) {
  30. foreach ($cfg['headers'] as $val) $headers .= "\n".$val;
  31. }
  32. $headers .= "\n".$cfg['header_plain'];
  33. if (!@mail($addr, $cfg['subj_conf'], sprintf($cfg['msg_conf'], '?type=confirm&email='.urlencode($addr)), $headers)) {
  34. $err = 'There was an error sending the confirmation email. Please try again later.';
  35. }
  36. }
  37. if (!isset($err)) {
  38. // confirmation sent
  39. if (isset($cfg['returnto_conf']) && $cfg['returnto_conf'] != '') {
  40. header('Location: '.$cfg['returnto_conf']);
  41. }
  42. else {
  43. printf($cfg['template'], 'KLIKNIJ ABY ZATWIERDZIC', 'http://www.club-acme.pl/txtlist/?type=confirm&email='.$addr.' ');
  44. }
  45. }
  46. else {
  47. // problem with subscription
  48. echoerr($err);
  49. }
  50. }
  51. elseif ($type == 'unsub') {
  52. // unsubscribe address
  53. $f = openfile($cfg['listfile']);
  54. $exists = false;
  55. while ($item = readitem($f)) {
  56. if ($item['addr'] == $addr) {$exists = true;break;}
  57. }
  58. if ($exists) {
  59. delitem($f, $item['id']);
  60. }
  61. else {
  62. $err = 'That address was not found.';
  63. }
  64. if (!isset($err)) {
  65. // unsubscribe successful
  66. if (isset($cfg['returnto_unsub']) && $cfg['returnto_unsub'] != '') {
  67. header('Location: '.$cfg['returnto_unsub']);
  68. }
  69. else {
  70. printf($cfg['template'], 'Unsubscribed', 'Your address, '.$addr.' has successfully been unsubscribed from our mailing list.');
  71. }
  72. }
  73. else {
  74. // problem with unsubscription
  75. echoerr($err);
  76. }
  77. }
  78. elseif ($type == 'confirm') {
  79. // subscribe a confirmed address
  80. if (!preg_match('#^([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)?[\w]+[^\".,?! ])$#i', $addr)) {
  81. $err = 'Your email address appears to be invalid. If you are pasting the URL from your confirmation email, make sure the URL wasn\'t split into two lines.';
  82. }
  83. if (!isset($err)) {
  84. $f = openfile($cfg['listfile']);
  85. $exists = false;
  86. while ($item = readitem($f)) {
  87. if ($item['addr'] == $addr) {$exists = true;break;}
  88. }
  89. if ($exists) {
  90. $err = 'That address is already subscribed to the list.';
  91. }
  92. }
  93. if (!isset($err)) {
  94. // subscribe successful
  95. writeitem($f, $addr);
  96. if (isset($cfg['returnto_sub']) && $cfg['returnto_sub'] != '') {
  97. header('Location: '.$cfg['returnto_sub']);
  98. }
  99. else {
  100. printf($cfg['template'], 'Subscribed', 'Your address, '.$addr.', is now subscribed to our mailing list!');
  101. }
  102. }
  103. else {
  104. // problem with subscription
  105. echoerr($err);
  106. }
  107. }
  108.  
  109. function echoerr($err) {
  110. printf($GLOBALS['cfg']['template'], 'Error', '<font color="red">Error: '.$err.'</font>');
  111. }
  112. ?>


caly plik config.inc.php

  1. <?
  2. // Change these login details first!
  3. $cfg['uname'] = 'deejey90';
  4. $cfg['pword'] = 'dawidek321';
  5.  
  6. // The default FROM address, and the address subscription confirmation emails will come from.
  7. $cfg['from'] = 'deejey90@gmail.com';
  8.  
  9. // The address to which CC'd emails and test emails will be sent.
  10. $cfg['ccaddress'] = 'deejey90@gmail.com';
  11.  
  12. // When sending, txtList will pause every pauseinterval'th email, for pausetime seconds.
  13. $cfg['pauseinterval'] = 100;
  14.  
  15. // Number of seconds to pause at each pauseinterval.
  16. $cfg['pausetime'] = 3;
  17.  
  18. // The file storing the list of email addresses. Move it for security.
  19. $cfg['listfile'] = 'mailing.txt';
  20.  
  21. // The subject of the confirmation email
  22. $cfg['subj_conf'] = 'Dodawanie e-mailu do newslettera ACME MUSIC CLUB';
  23.  
  24. // The body of the confirmation email. Note the confirmation URL: it must point to the same place
  25. // the subscribe / unsubscribe form does, and the %s characters must appear at the end.
  26. $cfg['msg_conf'] = "Czesc,
  27.  
  28. Aby dodac swoj adres do newslettera strony www.club-acme.pl, wystarczy kliknac w link.
  29.  
  30. link: <a href="http://www.club-acme.pl/txtlist/%s&quot;;" target="_blank">http://www.club-acme.pl/txtlist/%s";</a>
  31.  
  32. // These three values are optional URLs to which to redirect, instead of displaying the default
  33. // success messages. Currently, error messages are always displayed in the standard
  34. // template. Note: URLs must be absolute, e.g. <a href="http://mysite.com/subscribe.html" target="_blank">http://mysite.com/subscribe.html</a>, not subscribe.html
  35.  
  36. // Page to redirect to after confirmation email is sent.
  37. $cfg['returnto_conf'] = '';
  38.  
  39. // Page to redirect to after successful subscription.
  40. $cfg['returnto_sub'] = '';
  41.  
  42. // Page to redirect to after unsubscription.
  43. $cfg['returnto_unsub'] = '';
  44.  
  45. // This is the default template for success and error pages. The two '%s' identifiers are replaced
  46. // by the title and body of the page, in that order. Use %% to represent literal %.
  47. $cfg['template'] = '
  48. <html><head><title>Newsletter: %s</title>
  49. <style type="text/css">
  50. body {font-family: Arial; font-size: 10pt;}
  51. .smalltxt A {font-size: 8pt; color: #cdcdcd;position:absolute;top:85%%;left:65%%}
  52. </style></head><body>
  53. <div align="center">
  54. %s
  55. <br><br><br><br><a href="java script:window.close()">Close</a></div><br><div align="right" class="smalltxt"><a href="http://www.club-acme.pl" target="_new"> deejey90</a></div></body></html>';
  56.  
  57. // Additional headers to apply to outgoing emails.
  58. $cfg['headers'][] = 'Mime-Version: 1.0';
  59. $cfg['headers'][] = 'Content-Transfer-Encoding: 8bit';
  60.  
  61. // The HTML and plaintext headers are applied depending on the mail type. You may need to change
  62. // the charset attribute if you use a different character set.
  63. $cfg['header_html'] = 'Content-type: text/html; charset="iso-8859-1"';
  64. $cfg['header_plain'] = 'Content-type: text/plain; charset="iso-8859-1"';
  65.  
  66. // Specifies whether to archive emails sent to the list. This must be on for send resuming to be an
  67. // option. true = on, false = off.
  68. $cfg['savemail'] = true;
  69.  
  70. // Specifies the directory to which to save archived emails. Do not include a trailing slash!
  71. // If you want to indicate the current directory, use '.'
  72. $cfg['savemailto'] = 'archive';
  73.  
  74. // Specifies whether to save resume data as emails are sent. If disabled, you cannot
  75. // resume a failed send. This option has no effect unless savemail is on. true = on, false = off.
  76. $cfg['enableresume'] = true;
  77.  
  78. ?>


Tak wyglada okienko wyskujace

  1. <html><head><title>Newsletter: KLIKNIJ ABY ZATWIERDZIC</title>
  2. <style type="text/css">
  3. body {font-family: Arial; font-size: 10pt;}
  4. .smalltxt A {font-size: 8pt; color: #cdcdcd;position:absolute;top:85%;left:65%}
  5. <div align="center">
  6. <a href="http://www.club-acme.pl/txtlist/?type=confirm&email=deejeyff@o2.pl" target="_blank">http://www.club-acme.pl/txtlist/?type=conf...=deejeyff@o2.pl</a>
  7. <br><br><br><br><a href="java script:window.close()">Close</a></div><br><div align="right" class="smalltxt"><a href="http://www.club-acme.pl" target="_new"> deejey90</a></div></body></html>


Program do newslettera to txtlist 1.5

Chciałbym osiągnąć albo

1. aby nie trzeba bylo klikac w ten link (w tej chwili kopiowac tego tekstu ) i automatycznie adres dodawal sie do bazy mailingowej

albo chociaz 2. zeby to byl link potwierdzajacy w ktory trzeba kliknac.



Bardzo prosze o pomoc! Jestem zielony a bardzo tego potrzebuje.