I am not really good with PHP and stuff, but I am trying to integrate my phplist subscribe page with my website but I don''t have much of a success. What I want to do is just put a form on my homepage with an Email Address field and a submit button, and have that sign people up. Unfortunately I when you fill in the form on my site I get redirected to http://www.example.com/newsletter/?p=subscribe where I get the following message:
"The following required values are missing: Email Addresses you entered do not match"
And I need to fill the e-mail address again in order to receive a confirmation letter and I can not solve this step.
I tried to follow all the instructions: clicked "Don't display email confirmation" button, also, 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
My code is as follow:
- Code: Select all
</div>
<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;
}
</script>
<form method="post" action="http://www.mydomain.com/newsletter/?p=subscribe" name="subscribeform">
Email:<input type="text" name="email" value = ""><br>
<script language="Javascript" type="text/javascript">addFieldToCheck("email","Email Address");</script>
Name: <input type="text" name="attribute2" value = "">
<script language="Javascript" type="text/javascript">addFieldToCheck("attribute2","Name");</script>
<input type="hidden" name="list[1]" value="test" />
<input type="submit" name="subscribe" value="Subscribe" onClick="return checkform();">
</form>
<!-- newsletter subscribe ends here -->
</div>
<div class="clear"> </div>
</div>
</div> <!-- end content_container -->
</div> <!-- end site_container -->
</div> <!-- end site_container_aligner -->
</body></html>
I am sure it is something not that complex, but because of lack of understanding I can not solve it. I would be very thankful if somebody can help me with this.
Thanks