[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 H2B2 » 6:41pm, Tue 21 Nov, 2006

beanstalk wrote:just want comments and enough people using it that we could ask the developers to change some code such that we would not have to modify any of the phplist files and could more easily upgrade.
The point you are making seems valid to me. I think you could post a feature request anyway (including a link to your post), even without feedback from users.
Last edited by H2B2 on 6:42pm, Tue 21 Nov, 2006, edited 1 time in total.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby beanstalk » 6:42pm, Tue 21 Nov, 2006

thanks for the reply. i just want to know that i'm not crazy...or at least on this topic.
beanstalk
PL Nut
 
Posts: 23
Joined: 3:19pm, Fri 20 Oct, 2006
Location: Ohio

ie v.s. firefox

Postby gchaimovitz » 12:19am, Fri 24 Nov, 2006

With the setup listed within this thread I can get it to work with firefox with no problems, within ie i keep getting pushed to the subscription page.

Any suggestions?
gchaimovitz
phpList newbie
 
Posts: 1
Joined: 8:45pm, Thu 23 Nov, 2006

Postby H2B2 » 3:25am, Fri 24 Nov, 2006

Perhaps if you'd post your form or an url...
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby Aaaant » 5:14pm, Sun 26 Nov, 2006

Thanks a million, that code works for me as well perfectly. Is there a way to get the form to pop up to a new window when submit is pressed?

Thanks

Ant
Aaaant
phpLister
 
Posts: 5
Joined: 5:10pm, Sun 26 Nov, 2006

Postby H2B2 » 12:54am, Mon 27 Nov, 2006

Is there a way to get the form to pop up to a new window when submit is pressed?

To open a new window upon submit you could try adding target = "_blank" to your form tag. For instance, if this would be your current form tag:
Code: Select all
<form method="post" action="http://mywebsite.com/newsletter/lists/?p=subscribe" name="subscribeform">

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

Postby Aaaant » 11:43am, Mon 27 Nov, 2006

Thanks for the pointer. Is there a way to specify the window size? I know it'll be javascript functions, but figuring out how to implement it in the javascript that's there is proving troublesome.

Thanks
Aaaant
phpLister
 
Posts: 5
Joined: 5:10pm, Sun 26 Nov, 2006

Postby Aaaant » 6:08pm, Mon 27 Nov, 2006

I'm really naughty, I've just answered my own question. This is the solution:

Code: Select all
<form method="post" action="http://www.mysite.com/lists/?p=subscribe" name="signup" target="windowName" onsubmit="window.open('', this.target,
'dialog,modal,scrollbars=no,resizable=no,width=550,height=300,left=0,top=0');">


I wonder if there's an ajax option as well?
Last edited by Aaaant on 6:45pm, Mon 27 Nov, 2006, edited 1 time in total.
Aaaant
phpLister
 
Posts: 5
Joined: 5:10pm, Sun 26 Nov, 2006

Postby H2B2 » 6:35pm, Mon 27 Nov, 2006

You can display the full code by editing your post, paste the code again, and make sure you click on "Disable HTML in this post" on the left hand side of your editing window.

For an example popup code, you could also take a look at this post: http://forums.phplist.com/viewtopic.php?p=5515#5515
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Help appreciated

Postby bgem » 5:15am, Sat 02 Dec, 2006

Ok I'm basically trying to get my Subscribe to the Newsletter Form to show up on my Home page without the need for Subscribers to confirm their email, they just enter their email and presto they are subscribed to the newsleter.

This was actually the original setting for my shopping script, but due to an excess of subscribers, I had to change to PHPList to send out newsletters or face suspension of my site cause I was sending out too much Newsletter (just how much is too much?)(still not pleased with this cause my shopping script already came fully formatted with the auto function and backend feature to send out newsletters no matter how many subscribers they were - but oh well)

Anyway, I modified the code to get Subscribers to sign up for the Newsletters, but this is the best I can do without running into errors, any help on how to get the code to just show the Email Form and let them add their address and Presto they are automatically added to my email list in the backend on PHPList?

See the site http://www.soulink.net
Code: Select all
{* news *}

<table>

<form>

   {section name=i loop=$news_array}
   <tr>
      <td>
         <b><font>{$news_array[i].add_date}</font></b>
      </td>
   </tr>
   <tr>
      <td>
         <font>{$news_array[i].title}</font>
         <br><br>
      </td>
   </tr>
   {/section}


   {if $news_array}
   <tr>
      <td>
         <a>
            <b>
               {$smarty.const.STRING_ALL_NEWS}...
            </b>
         </a>
      </td>
   </tr>
   {/if}

   <tr>
      <td>

      {if $subscribe == NULL} {* show newsletter subscription form *}

         {if $error_message}
            <font><b>{$error_message}</b></font>
         {/if}

         <p>
         <font>{$smarty.const.CUSTOMER_SUBSCRIBE_FOR_NEWS}:</font>
         <br>
         <a>The SOUL INK Newsletter </a><br>
         <input>

         {if $productID ne NULL}
            <input>
         {/if}
         
         {if $categoryID ne NULL}
            <input>
         {/if}

      {else} {* show 'thank you' message *}

         <font>{$smarty.const.STRING_THANK_YOU}</font>

      {/if}
      </td>
   </tr>

</form>

</table>
bgem
phpList newbie
 
Posts: 1
Joined: 5:05am, Sat 02 Dec, 2006

Re: Help appreciated

Postby H2B2 » 1:29pm, Sun 03 Dec, 2006

bgem wrote:any help on how to get the code to just show the Email Form and let them add their address and Presto they are automatically added to my email list in the backend on PHPList?

There are a couple of mods that should allow direct susbscription without the need for users to confirm their subscription, e.g.:
http://forums.phplist.com/viewtopic.php?p=13312#13312
http://forums.phplist.com/viewtopic.php?p=4026#4026

There might be more. So please search the forum.

P.S. The code in your previous post seems truncated. Please edit your post, paste the code again, and make sure you click on "Disable HTML in this post" on the left of the editing window.
H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby Gulfstream » 4:01pm, Thu 28 Dec, 2006

This is a bit off topic but similar in nature... Can this same method be used for the admin login?

The client logs onto our homepage, and sees a form that says Client Login. They enter user/pass and they are directed the adminpage.

Thanks!
Gulfstream
phpLister
 
Posts: 10
Joined: 4:01pm, Mon 27 Nov, 2006

Postby H2B2 » 5:14pm, Tue 02 Jan, 2007

H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006

Postby garfpaw » 11:07pm, Wed 10 Jan, 2007

Hello~
I'm having a problem with IE when signing up to the list I've put on my page.

I've gone through all the steps, I've tried with and with out the &id=# both seem to do the same thing in either Firefox or IE, Firefox it works perfectly and in IE it redirects to the subscription page saying required field. My config page is set to true. Currently I have the index page set to just subscribe all of the other pages are set to subscribe&id=6 (6 is the correct list number for this list). I do how ever not have the list installed on this website, I maintain a bunch of different websites and I put the main list on our main website, not sure if that makes a difference. the site in question is scrapmap dot com any help would be greatly appreciated!

Edit: strike that, without the &id=6 on Firefox it doesn't redirect properly
garfpaw
phpList newbie
 
Posts: 1
Joined: 10:56pm, Wed 10 Jan, 2007

Postby johnfrw » 10:53pm, Mon 15 Jan, 2007

I chose phplist because of this very helpful forum and have already received lots of help from searching the forum, but .....

I have incorporated a subscribe page in my site and the form looks great but when I click the submit button I just get redirected to

http://mysite/mysite/lists/?p=subscribe

I've tried allsorts and can't fix this - any help very gratefully received.

thanks in advance - code below


<script language="Javascript" type="text/javascript">

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;
}

function compareEmail()
{
return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}

</script>
</p>
<form method=post action="http:/mysite/lists/?p=subscribe" name="subscribeform"><table border=0>
<tr><td><div class="feature">Email</div></td>
<td class="feature">
<span class="feature">
<input type=text name=email value="" size="40">
<script language="Javascript" type="text/javascript">addFieldToCheck("email","Email");</script>
</span></td></tr><tr><td colspan=2 class="feature">
Preferred format for emails:<br/>
<input type=radio name="htmlemail" value="0" />
Text
<input type=radio name="htmlemail" value="1" checked />
HTML</td></tr>

<tr><td><div class="feature">name</div></td><td class="attributeinput">
<span class="feature">
<input type=text name="attribute1" class="attributeinput" size="40" value="">
<script language="Javascript" type="text/javascript">addFieldToCheck("attribute1","name");</script>
</span></td></tr>

<tr><td><div class="feature">post code</div></td><td class="attributeinput"> <span class="feature">
<input type=text name="attribute4" class="attributeinput" size="40" value="">
</span></td></tr>

<tr><td><div class="feature">phone number</div></td><td class="attributeinput"> <span class="feature">
<input type=text name="attribute5" class="attributeinput" size="40" value="">
</span></td></tr>
<tr><td colspan=2>
<span class="feature">
<input type="checkbox" name="attribute6" value="on" class="attributeinput">
Subscribe to Lists</span></td></tr>
</table>

<p>
<span class="feature">
<!-- CODE REMOVED FROM HERE-->

<input type=submit name="subscribe" value="Subscribe to the Selected Newsletters" onClick="return checkform();">
</span></p>
</form>
<p class="feature"><br/>
<br/>
<a href="http://mysite/phplist/?p=unsubscribe&id=1">Unsubscribe</a>

<style type="text/css">
.poweredphplist {font-family: arial, verdana, sans-serif;font-size : 10px; font-variant: small-caps; font-weight : normal; padding: 2px; padding-left:20px;}
a:link.poweredphplist,
a:active.poweredphplist,
a:visited.poweredphplist {font-family: Arial, verdana, sans-serif; font-size : 10px; font-variant: small-caps; font-weight : normal; color : #666666; text-align : center; text-decoration : none; padding: 2px;}
a:hover.poweredphplist {color : #7D7B7B;}
</style>
powered by <a href="http://www.phplist.com" class="poweredphplist" target="_blank">phplist</a> v 2.10.2, &copy; <a href="http://tincan.co.uk/powered" target="_blank" class="poweredphplist">tincan ltd</a>
</p>
</p>

*********************************************

The code <!-- CODE REMOVED FROM HERE--> was
<input type="hidden" name="list[2]" value="signup">
<input type="hidden" name="listname[2]" value="ASDW Mailing List"/>

*************************************************

thanks
johnfrw
phpList newbie
 
Posts: 4
Joined: 9:00pm, Mon 20 Mar, 2006

PreviousNext

Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests

cron