[how to] put a subscribe form on one of my website pages

Solutions for other phpList version 2 users
Forum rules
Please do not ask questions here, this is for Solutions you have discovered or come across.

Postby tomraffe » 2:44pm, Mon 18 Sep, 2006

Now works well. Thanks very much for your help!
tomraffe
phpLister
 
Posts: 5
Joined: 12:10pm, Mon 18 Sep, 2006

Same problem as above

Postby jdarling » 12:02am, Mon 25 Sep, 2006

Getting this error on a custom form once I submit:

"The following required values are missing: Email Addresses you entered do not match"

I disabled email confirmation in Admin >> subscribe pages >> checking the radio button "Don't display email confirmation" but I'm still getting the error.
jdarling
phpLister
 
Posts: 8
Joined: 12:00am, Mon 25 Sep, 2006

Re: Same problem as above

Postby H2B2 » 1:50am, Mon 25 Sep, 2006

jdarling wrote:"The following required values are missing: Email Addresses you entered do not match"

I disabled email confirmation in Admin >> subscribe pages >> checking the radio button "Don't display email confirmation" but I'm still getting the error.
If you have several subscribe pages defined in the admin backend, try disabling email confirmation for all subscribe pages. Don't forget to "Save and activate".
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Subscription php

Postby sarelvdm » 8:48pm, Thu 28 Sep, 2006

Please help me to modify the example code, it only got an email and name field.

How do I, instead of using a subscribe page, just put a form on my homepage with the following and a submit button, and have that sign people up?


Required fields
===============
Email
Confirm email
I prefer to receive emails in html format (tick box)
Name
Surname
Gender

Mandatory fields
================
Mobile number
Telephone number work
Telephone number home


The phplist_user_attribute table consists of the following
==================================================
`phplist_user_attribute` VALUES (1, 'Name', 'textline', 1, '', 1, 'name');
`phplist_user_attribute` VALUES (2, 'Surname', 'textline', 2, '', 1, 'surname');
`phplist_user_attribute` VALUES (3, 'Gender', 'textline', 3, '', 1, 'gender');
`phplist_user_attribute` VALUES (4, 'ID number', 'textline', 4, '', 1, 'idnr');
`phplist_user_attribute` VALUES (5, 'Mobile number', 'textline', 5, '', 0, 'mobile');
`phplist_user_attribute` VALUES (6, 'Telephone number - W', 'textline', 6, '', 0, 'telw');
`phplist_user_attribute` VALUES (7, 'Telephone number - H', 'textline', 7, '', 0, 'telh');

============== START CODE ======================

<script>
var fieldstocheck = new Array();
fieldnames = new Array();
function checkform() {
for (i=0;i<fieldstocheck.length;i++) {
if (eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].value") == "") {
alert("Please enter your "+fieldnames[i]);
eval("document.subscribeform.elements['"+fieldstocheck[i]+"'].focus()");
return false;
}
}
return true;
}
function addFieldToCheck(value,name) {
fieldstocheck[fieldstocheck.length] = value;
fieldnames[fieldnames.length] = name;
}
</script>

<form>
Email:<input>

<script>addFieldToCheck("email","Email Address");</script>
Name: <input>
<script>addFieldToCheck("attribute2","Name");</script>
<input>
<input>
</form>

============== END CODE ======================
sarelvdm
PL Nut
 
Posts: 15
Joined: 5:49pm, Sun 17 Sep, 2006

Postby H2B2 » 9:27pm, Thu 28 Sep, 2006

Considering this form is a bit more complex than the previous ones, i think the best way to proceed is to let phplist do the 'dirty work' of generating the form code. Than you only need to copy the form code, customize it a little bit, and place it on your webpage.

So, I suggest you go through the following steps:

1. In Admin >> subscribe pages: Create a subscribe page with all the attributes you need, select wich attributes are "required", and set the order of listing. Don't forget to click on "Save and activate".

2. Now you need to copy the phplist generated html form code to a text editor. You can do this by:
- loading the subscribe page you just created in your web browser, i.e. just point your browser to your subscribe page.
- display the source code for that page (right click on the page and select 'View source' in IE, or 'View page source' in Firefox).
- copy the form code (including the javascript that checks user input), and paste this in a simple text editor, like Windows Notepad.

3. Customize the form code as described in a previous post of this thread.

Now you're ready to place the customized form in a tabel cell or anywhere you want on an existing webpage. Further customization can be done in your html editor, if you prefer.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby sarelvdm » 9:01pm, Fri 29 Sep, 2006

H2B2 wrote:Considering this form is a bit more complex than the previous ones, i think the best way to proceed is to let phplist do the 'dirty work' of generating the form code. Than you only need to copy the form code, customize it a little bit, and place it on your webpage.

So, I suggest you go through the following steps:

1. In Admin >> subscribe pages: Create a subscribe page with all the attributes you need, select wich attributes are "required", and set the order of listing. Don't forget to click on "Save and activate".

2. Now you need to copy the phplist generated html form code to a text editor. You can do this by:
- loading the subscribe page you just created in your web browser, i.e. just point your browser to your subscribe page.
- display the source code for that page (right click on the page and select 'View source' in IE, or 'View page source' in Firefox).
- copy the form code (including the javascript that checks user input), and paste this in a simple text editor, like Windows Notepad.

3. Customize the form code as described in a previous post of this thread.

Now you're ready to place the customized form in a tabel cell or anywhere you want on an existing webpage. Further customization can be done in your html editor, if you prefer.


Thanks it worked...

What must I do to change this page.

"Thank you for subscribing to the newsletters.
Your email has been added to our system. You will be e-mailed shortly with a request to confirm your membership. Please make sure to click the link in that message to confirm your subscription."

I want to remove all the logo's and change the format.


Thanks
sarelvdm
PL Nut
 
Posts: 15
Joined: 5:49pm, Sun 17 Sep, 2006

Postby Lee Pilzer » 12:42am, Sun 01 Oct, 2006

sarelvdm,

The text of the "Message they receive when they subscribe", the text of the "Message they receive when they confirm their subscription", and the header and footer can all be edited on the subscribe page. Log-in to PHPList Admin; click "subscribe pages"; click "edit" for the subscribe page that you are using; then scroll down to the appropriate fields and edit accordingly.

-- Lee
Lee Pilzer
PL Master
 
Posts: 205
Joined: 12:26pm, Fri 14 Oct, 2005
Location: New York

Still problems with subscription form

Postby berget » 8:28pm, Sun 01 Oct, 2006

Hi all,

I have been reading this topic over and over again and I have
been doing all sorts of editing in my code, but I still can´t
get my subscription form to work.

I want my subscription form to capture email and name,
and subscribe the person to my ezine, without them
having to visit the subscription page of phplist.

I can´t seem to figure out where and what I have done something
wrong in the code, I hope someone here can help me.

The page I am referring to is this:

http://www.thegifthelper.com

When you sign up here, you will just get sent to the subscription
page at phplist.

Can you please take a look in my code and see what I have to
do in order to get people to sign up directly using my subscription
form?

Regards,
Jens P. Berget

PS. If you need, I can attach the code I am currently using.
berget
phpList newbie
 
Posts: 3
Joined: 8:20pm, Sun 01 Oct, 2006

Re: Still problems with subscription form

Postby H2B2 » 9:18pm, Sun 01 Oct, 2006

berget wrote:When you sign up here, you will just get sent to the subscription page at phplist.

As described in a previous post of this thread, you need to change this:
Code: Select all
<form method="post" action="http://thegifthelper.com/ezine/?p=subscribe&id=1" name="subscribeform" target="_self">

to this:
Code: Select all
<form method="post" action="http://thegifthelper.com/ezine/?p=subscribe" name="subscribeform" target="_self">
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby berget » 9:30pm, Sun 01 Oct, 2006

I have done this (again), but I am still being sent to the subscription page at phplist:

http://thegifthelper.com/ezine/?p=subscribe

Thanks for your quick reply.

Regards,
Jens P. Berget
berget
phpList newbie
 
Posts: 3
Joined: 8:20pm, Sun 01 Oct, 2006

Postby H2B2 » 9:52pm, Sun 01 Oct, 2006

If you compare your form with one of the other forms posted in this tread, you will see that you have an additional hidden input tag:
Code: Select all
<input type="hidden" name="listname[1]" value="The Gift Helper"/>
Try removing it.

Also check, in the Admin backend, whether the listID number is correct.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby berget » 9:59pm, Sun 01 Oct, 2006

Thanks.

I have removed the extra hidden input tag (I think I have added it just to try if it would work). And it seems that the list id is ok.

Do you have any other suggestions? I am really stuck here :)

Regards,
Jens P. Berget
berget
phpList newbie
 
Posts: 3
Joined: 8:20pm, Sun 01 Oct, 2006

Postby H2B2 » 10:12pm, Sun 01 Oct, 2006

You may have missed something, but it's difficult to debug from here. Perhaps it would be best if your start from scratch and try the procedure described in this post
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby sarelvdm » 9:27am, Mon 02 Oct, 2006

Lee Pilzer wrote:sarelvdm,

The text of the "Message they receive when they subscribe", the text of the "Message they receive when they confirm their subscription", and the header and footer can all be edited on the subscribe page. Log-in to PHPList Admin; click "subscribe pages"; click "edit" for the subscribe page that you are using; then scroll down to the appropriate fields and edit accordingly.

-- Lee


Hi Lee,

I want to change the confirmation subscription page layout. It is the page that is displayed (on browser) after you subscribe. The email message is not the problem.

Thanks

Sarel
sarelvdm
PL Nut
 
Posts: 15
Joined: 5:49pm, Sun 17 Sep, 2006

Postby H2B2 » 3:30pm, Wed 04 Oct, 2006

berget wrote:I have removed the extra hidden input tag (I think I have added it just to try if it would work). And it seems that the list id is ok.

Do you have any other suggestions?

Check this setting on the configuration page (admin >> configure):
- if there is only one visible list, should it be hidden in the page and automatically subscribe users who sign up (0/1)
true
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

PreviousNext

Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests