Skip to main content
Beacon9.ca
interactive media for the web

Main menu

  • Home
  • Portfolio
  • Labs
  • Contact

Search form

PHPlist Integration w/ AJAX

A while ago I got asked to create a form that sent newsletter subscriptions on a PHP based website to PHPlist, a popular, open source email campaign manager. The idea being that people viewing the website could sign up then and there for email newsletters.

I've posted the code (with permission) and added some javascript that will handle the posting of the form with AJAX.

Using the script

  • Configure the script - You'll need to add a url to the "$url" variable (line 15 - this should be the link to your current phplist subscribe page) and fill in the listname to "listname[1]" of the "$postfields" array (line 23 - if you are unsure of the name copy it from your current PHPlist subscribe page).
  • Decide if you want to use AJAX post by commenting/uncommenting the line where we include the ajax.js file (line 113-114).
  • Integrate into your site. This will be different for everyone, if you need a hand leave a comment and I can help out.

As always, leave me a comment if you end up using it.

Demo: 
http://labs.beacon9.ca/phplist/phplist.php
File Attachment: 
phplist-integration-1.0.zip

Spread The Love

Tweet
  • Add new comment

Comments

t's picture

Exactly what I was looking

Permalink Submitted by t (not verified) on Tue, 04/05/2011 - 09:10

Exactly what I was looking for, thanks!

  • reply
Frederic's picture

Hi

Permalink Submitted by Frederic (not verified) on Fri, 07/01/2011 - 04:14

Hi

Thanks for this code.
It looks exactly same what i was looking for.

Thanks
Frederic Anand

  • reply
jack's picture

glad you like it ;-)

Permalink Submitted by jack on Fri, 07/01/2011 - 13:08

glad you like it ;-)

  • reply

Add new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.

More information about text formats

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Email Facebook RSS

From the Labs

  • Drupal Social Popularity Module
    | 26 Nov
  • Drupal 7 Facebook Comments
    | 08 Nov
  • Drupal Mobile Redirect Module
    | 24 May
  • Drupal 7 Private Files Module
    | 30 Apr
  • Drupal 7 Sitemap Block Module
    | 11 Dec

View Labs

From The Portfolio

View Portfolio

Rank us on #rankable

Copyright © 2009-2010 BEACON9 All rights reserved. Admin Login Powered by Drupal