Index

  1. Project Infos
  2. Frequently Asked Questions (FAQ)
  3. Known Errors

 

 

I. Project Infos

project:   Jax Newsletter (program for running a mailinglist)
     
file:   jax_newsletter.php
     
version:   1.4 (optional database support)
     
interpreter:      PHP 4.02+, 4.1+ (ready for register_globals=off)
     
code:   Andreas John
     
design:   Andreas John
     
homepage:   www.jtr.de/scripting/php/newsletter
     
license:  

Copyright (C) 2001-2002, Andreas John (Jack (tR))

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. A copy of this license you can find in the added text file gpl.txt or on the website of the Free Software Foundation under:

http://www.fsf.org/copyleft/gpl.html

Please note, that I can give NO WARRANTY FOR DAMAGES CAUSED BY THE USE OF THE PROGRAM...

 

credits:  

I want to say a Big Thank You to all the people supporting this and other Open Source Projects by giving hints, translations and link it on their websites...

Special thanx go to:

Martin Sondermann
http://www.kunstphotografie.de
for his personal support
   

Wojciech Dorosz
http://www.serwisy.net

for the Polish language template
   

Tamas Herczeg
http://www.soft-trans.hu

for the Hungarian language template
   

Jan-Ruben van Schie
http://www.jrwebdsign.nl

for the Dutch language template
   

Giovanni Scopel [skop@keymail.net]

for the Italian language template
   

 

II. Frequently Asked Questions (FAQ):

  1. What's Jax Newsletter ? What do I need it for?

    1. 1. How do the scripts work?

  2. How to install Jax Newsletter on my website (without MySQL) ?

  3. How to use Jax Newsletter with MySQL?

  4. How many entries Jax Newsletter can handle?

  5. Can Jax Newsletter handle several Newsletters?

  6. How to save more user related data ?

  7. Where can I get current Information about Updates/Changings?

 

1. What's Jax Newsletter ? What do I need it for?

Jax Newsletter is a Script for running mailinglists directly on your website, to adminster and post e-mails to that lists. (Mailinglist Manager)

Current features of Jax Newsletter:

 

How do the scripts work?

 

The mailinglist scripts (by default) do the following:

 

1. How to call the scripts

The start script is jax_newsletter.php and can be called with the following parameters:

 

Example:

http://..../jax_newsletter.php?ml_id=1&language=English

ml_id defines the mailinglist that is used. If you set no parameter, ml_id is set to 0

 

The following examples base on the case that you want to adminster two mailing lists. One group (ml_id=1) for all English-speaking and one group (ml_id=0) for all German-speaking recipients...

 

If you set the parameter ml_id you have to fit globals.inc.php before (as described in --> Can Jax Newsletter handle several Newsletters? )

language tells the script which language template to use. If you set the parameter make sure the template file exists in the directory language.

jax_newsletter.php leads the visitor onto two input forms where she can sign in (sign_in.php) or sign out (sign_out.php).

Alternatively you can use the form sign_in_out.php, which combines the sign in and sign out formular. The parameters are identical with the call of jax_newsletter.php...

Of course you can build the forms also directly into your web pages...

 

2. Sign in / Sign out

If the visitor signs in or out the mailinglist her input data are stored in a log file (by default both mailinglists logs are stored in records.csv). Additionally a key is generated by random (pseudo-random) and is saved together with the e-mail-address in the file subscribers.csv.

To make sure noone else signs in or out an other one's e-mail-adress, the script sign.php sends a confirmation e-mail to the "owner" of the e-mail-address. This e-mail contains a hyperlink to the script verify.php. The recipient only have to click it to sign in or sign out:

 

Example:

http://.../newsletter/verify.php?language=German&ml_id=0&do=sign&uid=3et60c4i45....

do tells the script whether the visitor signs in or out.

uid contains the key created by sign.php. Now verify.php compares the key in the link with the keys in the file subscribers.csv. Are they equal, the coresponding entry in the file subscribers.csv goes deleted and the e-mail-address is transfered to the corresponding mailinglist (mailinglist.csv)...

 

3. Administration of the mailinglists / Manual Changing of entries

If you want to delete a recipient from mailinglist manually you can use the script list.admin.php in the direcotry admin. To use it, best call the script index.php in the same directory!

Example:

http://..../admin/index.php?language=German


4. Sending messages to the mailinglist

To send a message to the mailinglist call the script posting.php (best use index.php too). Choose the recipients group, enter a subject and message and finally press send button.

Important:

To enable the script to send all messages you have to keep browser connection open. You may not close the browser window or press break button before you get a confirmation that all e-mails have been send!

 

2. How to install Jax Newsletter on my website?

Jax Newsletter was written in PHP 4. It requires PHP - a server side scripting language that enables you to design websites with dynamical generated content! (If you did not already - ask your provider for PHP support!)

You don't need database support to run Jax Newsletter!

If you have PHP support on your website do the following:

  1. download the latest version of Jax Newsletter under http:/www.jtr.de/scripting/php/newsletter !

  2. unzip the archive!

  3. Open the file globals.inc.php (in the directory newsletter) with a textedito and fit the entries to your needs!

  4. Load the scripts to your website!

    After uploading the script to your webspace make sure (by changing the file attributes and owner) the script can full access the csv-files (normally "mailinglist" - the mailinglist, "records" - the log file and "subscriberlist" - file with the newcomers)

    (best - later you change the file names and the coresponding settings in globals.inc.php)

  5. Don't forget to link the script on your website! ;-)
    Enjoy it!

  6. Important Hint:
    Please make sure (by correct configuration of your webserver) that nobody but yourself can access the administration scripts (in directory admin).

    If you are using an Apache Webserver you can protect directories against unauthorized access by setting up a .htaccess file. Also make sure that the directory which contains the script is not allowed to be listed... (Best you take the sample file _htaccess and rename it in .htaccess !)

 

3. How to use Jax Newsletter with MySQL?

Jax Newsletter can use CSV textfiles or MySQL database tables for saving the Newsletter entries. Using MySQL gives you better performance if you handle large mailinglists...

If you have MySQL support do the following:

  1. Install Jax Newsletter (see "How to install Jax Newsletter on my website?")

  2. Change the following entries in globals.inc.php !

    $newsletters[0]->db_server = "http://...";
    $newsletters[0]->db_login = "...";
    $newsletters[0]->db_database = "...";
    $newsletters[0]->db_password = "...";

  3. Set $newsletter[0]->data_source = "mysql" !

  4. Start phpMyAdmin (or your favorite MySQL monitor programm) and set up the following tables. MySQL-scheme:
    CREATE TABLE mailinglist_ger (
      id int(16) NOT NULL auto_increment,
      username varchar(64) NOT NULL default '',
      domain varchar(64) NOT NULL default '',
      PRIMARY KEY  (id)
    ) TYPE=MyISAM;
    
    
    CREATE TABLE records (
      id int(16) NOT NULL auto_increment,
      action char(1) NOT NULL default '',
      time datetime NOT NULL default '0000-00-00 00:00:00',
      ip varchar(15) NOT NULL default '',
      email varchar(128) NOT NULL default '',
      profession varchar(128) NOT NULL default '',
      age year(4) NOT NULL default '0000',
      nationality varchar(64) NOT NULL default '',
      PRIMARY KEY  (id)
    ) TYPE=MyISAM;
    
    
    CREATE TABLE subscribers (
      id int(16) NOT NULL auto_increment,
      date date NOT NULL default '0000-00-00',
      hash varchar(32) NOT NULL default '',
      email varchar(128) NOT NULL default '',
      PRIMARY KEY  (id)
    ) TYPE=MyISAM;
    
    
    CREATE TABLE archive_ger (
      id int(11) NOT NULL auto_increment,
      date date NOT NULL default '0000-00-00',
      time time NOT NULL default '00:00:00',
      title varchar(80) NOT NULL default '',
      content_file varchar(100) NOT NULL default '',
      PRIMARY KEY  (id)
    ) TYPE=MyISAM;
    
    
    * The table names has to be the same defined in the file globals.inc.php...
    
  5. Important Hint:
    Please make sure (by correct configuration of your webserver) that nobody but yourself can access the administration script (admin/list.admin.php).

    If you are using an Apache Webserver you can protect directories against unauthorized access by creating a .htaccess file

 

4. How many entries Jax Newsletter can handle?

I tested the script with a realistic amount of entries (about 2000 in CSV-file) and it did it's job. Theoretically (depending on your webserver's space and power) it should be able to handle a larger amount of a few thousands of entries. If you have a big mailing list, using MySQL data source is the better way...

 

5. Can Jax Newsletter handle several Newsletters?

No problem! :-)
If you want to handle mor than one Newsletter on your homepage there are two ways to accomplish it:

Either:

You put the script in seperate directorys (one for each mailig list). But this can become hard to handle the more lists you run.

Or:

You call the script using the parameter ml_id e.g:

http://../jax_newsletter.php?ml_id=1

For security reasons the name of the Newsletter file can not be forwarded with the URL.
The allocation of the Mailinglist IDs and the Newsletters you have (currently) to put manually in the file globals.inc.php:

...

// Title of the Newsletter
$newsletters[0]->title = "Jax Newsletter (English)";
$newsletters[0]->data_source = "csvfile";

// CSS template for the Newsletter
$newsletters[0]->css = "styles/default.css";
$newsletters[0]->do_log = true;
$newsletters[0]->logfile = "records.csv";
$newsletters[0]->subscriberlist = "subscribers.csv";
$newsletters[0]->mailinglist = "mailinglist_eng.csv";
$newsletters[0]->archive = "archive_ger.csv";
$newsletters[0]->db_server = "";
$newsletters[0]->db_login = "";
$newsletters[0]->db_database = "";
$newsletters[0]->db_password = "";

$newsletters[1]->title = "Jax Newsletter (German)";
$newsletters[1]->data_source = "mysql";
$newsletters[1]->css = "styles/default.css";
$newsletters[1]->do_log = true;
$newsletters[1]->logfile = "records";
$newsletters[1]->subscriberlist = "subscriberlist";
$newsletters[1]->mailinglist = "mailinglist";
$newsletters[1]->archive = "archive_eng.csv";
$newsletters[1]->db_server = "mysql9.webpack.hosteurope.de";
$newsletters[1]->db_login = "ftp19399";
$newsletters[1]->db_database = "mailinglist_de";
$newsletters[1]->db_password = "banana";

...

The example shows how to run a second Newsletter with the same script:

The second mailinglist list (used for the English recipients) uses a mysql-database server. It will be used by the URL http://../jax_newsletter.php?ml_id=1

Corresponding the URL http://../jax_newsletter?ml_id=2 used a third mailinglist and so on...

You can freely choose the data source (mysql/csvfile) for each mailinglist!

 

6. How to save more user related data?

By default Jax Newsletter saves the e-mail-Address, the IP-adress and the content of the variables profession, age and nationality which was entered by the user in the form sign_in.php.

If you want to prompt aditional date (e.g. the abonnents cats birthday ;-), change the following lines in sign.php:

if ( $log_signings )
{
$log = array();
$log[ "action" ] = "+";
$log[ "time" ] = $time_now;
$log[ "ip" ] = $REMOTE_ADDR;
$log[ "email" ] = $email;
$log[ "profession" ] = $profession;
$log[ "age" ] = $age;
$log[ "nationality" ] = $nationality;

$log[ "kitties_birthday" ] = $kitties_birthday;

$logbook->append( $log );
}

After you have to either to kill the log-CSV-file (records.csv) - then the script generates automatically a new head,

or you expand the first line with the name of the variables

 

"action","time","ip","email","profession","age","nationality","kitties_birthday"
"+","2002-03-03 21:14:47","127.0.0.1","jack@jtr.de","Webmaster","1978","Deutsch"

 

If you use a MySQL-database, you have to enhance the table for the logs:

ALTER TABLE `records` ADD `kitties_birthday` VARCHAR(30) NOT NULL;

 

Important Hint:

If you extend Jax Newsletter to register more data from your signers, please observe local and global laws of civil data protection.
In Germany (and European Union) for example we have some laws which protect the citizens against the data-greediness of people running (most often commercial) websites to trade with personal data.

You should always observe the principle of registering only user data which are absolutely nescessary for running the service. Not nescessary for running a mailing list are data which let you draw conclusions from of the person itself (e.g. confession, sexuality, health state and so on...)

Statistical data (like topics of interest, profession, and age) are perhaps important to fit the newsletter to your customers without touching their personality. To avoid trouble with data protection laws you should keep back and decide thoroughfully what's important and what's not...

 

7. Where can I get current Information about Updates/Changings?

  1. On the webpage (http://www.jtr.de/scripting/php/newsletter) of course! ;-)

  2. In the admin script - there is a link "check for latest updates". left of there is a little green spot. if it blinks green-yellow, there is an update. If it blinks red-yellow, there is a security relevant update!

  3. Sign in the jtr-Newsletter! (http://www.jtr.de/scripting/php/newsletter/newsletter)

 

III. Known Errors

- If the connection to the browser breaks during sending to mailinglist (e.g. if Proxy times out), not all recipients will get a message. Additionally it sending can take a lot of time if you send to big mailinglists.

Im working on alternatives! :-)

 

If you find any error or if you have proposals for improvement, please don't hesistate to contact me directly:

mailto: jack@jtr.de

 

Berlin, 26.03.2002 Jack (tR)