i try configure phplist 3.012. use own subscribe und unsubscribe pages. asked in newsgroup of phplist. unfortunaly gotten no response. no 1 seems use own subscribe pages. if input field on login page empty , i'll click on send button, says javascript me, "please enter valid e-mail address. after entered valid email address should appear error message. instead, login page phplist appears. please @ script , php-code. want have own popup windows , not thank pages phplist. has of phplist running own subscribe, unsubscribe , thank pages. must use made more changes index.php phplist.
thank help
<div class="page-footer"> <div id="newsletter"> <div class="form-horizontal"> <form action="http://example.com/?p=subscribe&id=1" method="post" class="newsletter" name="subscribeform" id="subscribeform"> <div class="form-group"> <label class="col-lg-2 col-md-2 col-sm-2 col-sx-2 control-label">form of address:</label> <div class="col-lg-6 col-md-6 col-sm-6 col-sx-6"> <label class="radio-inline"> <input type="radio" name="attribute1" value="1">mr</label> <label class="radio-inline"> <input type="radio" name="arttibute1" value="2">ms</label> </div> <!-- /.col-lg-6 col-md-6 col-sm-6 col-sx-6 --> </div> <!-- /.form-group --> <div class="form-group"> <label class="subscriber_titel col-lg-2 col-md-2 col-sm-2 col-sx-2 control-label">title:</label> <div class="col-lg-6 col-md-6 col-sm-6 col-sx-6"> <input type="text" class="form-control" name="attribute2" id="titel" placeholder="title" value="" /> </div> <!-- /.col-lg-6 col-md-6 col-sm-6 col-sx-6 --> </div> <!-- /.form-group --> <div class="form-group"> <label class="subscriber_vorname col-lg-2 col-md-2 col-sm-2 col-sx-2 control-label">first name:</label> <div class="col-lg-6 col-md-6 col-sm-6 col-sx-6"> <input type="text" class="form-control" name="attribute3" id="vorname" placeholder="first name" value="" /> </div> <!-- /.col-lg-6 col-md-6 col-sm-6 col-sx-6 --> </div> <!-- /.form-group --> <div class="form-group"> <label class="subscriber_name col-lg-2 col-md-2 col-sm-2 col-sx-2 control-label">last name:</label> <div class="col-lg-6 col-md-6 col-sm-6 col-sx-6"> <input type="text" class="form-control" name="attribute4" id="name" placeholder="last name" value="" /> </div> <!-- /.col-lg-6 col-md-6 col-sm-6 col-sx-6 --> </div> <!-- /.form-group --> <div class="form-group"> <label class="subscriber_email col-lg-2 col-md-2 col-sm-2 col-sx-2 control-label">e-mail:</label> <div class="col-lg-6 col-md-6 col-sm-6 col-sx-6"> <input type="text" class="form-control" name="email" id="email" placeholder="email@example.com" value="" /> </div> <!-- /.col-lg-6 col-md-6 col-sm-6 col-sx-6 --> </div> <!-- /.form-group --> <div class="form-group"> <label class="subscriber_land col-lg-2 col-md-2 col-sm-2 col-sx-2 control-label">land:</label> <div class="col-lg-6 col-md-6 col-sm-6 col-sx-6"> <input type="text" class="form-control" name="attribute5" id="land" placeholder="land" value="" /> </div> <!-- /.col-lg-6 col-md-6 col-sm-6 col-sx-6 --> </div> <!-- /.form-group --> <input type="hidden" name="htmlemail" value="1"> <div class="form-group"> <div class="col-sm-offset-0 col-sm-12"> <div class="checkbox"> <label> <input type="checkbox" name="list[1]" value="signup" checked />newsletter</label> </div> <!-- /.col-sm-offset-0 col-sm-12 --> </div> <!-- /.checkbox --> </div> <!-- /.form-group --> <div class="form-group"> <div class="col-sm-offset-0 col-sm-12"> <div class="checkbox"> <label> <input type="checkbox" name="list[2]" value="signup" checked />newsletter 2</label> </div> <!-- /.col-sm-offset-0 col-sm-12 --> </div> <!-- /.checkbox --> </div> <!-- /.form-group --> <div class="form-group"> <div class="col-lg-8 col-md-8 col-sm-8 col-sx-8"> <input type="reset" name="reset" value="reset" class="btn btn-default btn-sm" title="formular zurücksetzen"> <button class="btn btn-success btn-sm" role="button" type="submit" name="subscribe" id="postname" onclick="return checkform();" value="subscribe" title="subscirbe">subscribe newsletter</button> </div> <!-- /.col-lg-8 col-md-8 col-sm-8 col-sx-8 --> </div> <!-- /.form-group --> <hr class="style-red"> <div class="form-group"> <div class="col-lg-8 col-md-8 col-sm-8 col-sx-8"> <a class="btn btn-warning btn-xs" role="button" href="newsletter-unsubscribe.php" title="newsletter unsubscribe">unsubscribe</a> <a class="btn btn-info btn-xs" role="button" href="newsletter-change-personal-information.php" title="change personal information">change personal information</a> </div> <!-- /.col-lg-8 col-md-8 col-sm-8 col-sx-8 --> </div> <!-- /.form-group --> </form> <!-- /.form action--> </div> <!-- /.form-horizontal --> </div> <!-- /.newsletter --> </div> <!-- /.page-footer --> </div> <!-- /.well-white-01 --> </div> <!-- /.lg-col-8 col-md-8 col-sm-8 col-sx-8 --> <script type="text/javascript"> function checkform() { var reg = /^([a-za-z0-9_\-\.])+\@([a-za-z0-9_\-\.])+\.([a-za-z]{2,4})$/; var address = document.forms['subscribeform'].elements['email'].value; if (reg.test(address) == false) { alert('bitte geben sie ihre gültige email-adresse ein!'); document.forms['subscribeform'].elements['email'].focus(); return false; } else { document.forms['unsubscribeform'].elements['unsubscribeemail'].value = document.forms['subscribeform'].elements['email'].value; } if (document.forms['subscribeform'].elements['attribute1'].value == "") { alert('bitte die anrede auswählen!'); document.forms['subscribeform'].elements['attribute1'].focus(); return false; } else { document.forms['unsubscribeform'].elements['attribute1'].value = document.forms['subscribeform'].elements['attribute1'].value; return true; } if (document.forms['subscribeform'].elements['attribute3'].value == "") { alert('bitte geben sie ihren vornamen ein!'); document.forms['subscribeform'].elements['attribute3'].focus(); return false; } else { document.forms['unsubscribeform'].elements['attribute3'].value = document.forms['subscribeform'].elements['attribute3'].value; return true; } if (document.forms['subscribeform'].elements['attribute4'].value == "") { alert('bitte geben sie ihren nachnamen ein!'); document.forms['subscribeform'].elements['attribute4'].focus(); return false; } else { document.forms['unsubscribeform'].elements['attribute4'].value = document.forms['subscribeform'].elements['attribute4'].value; return true; } if (document.forms['subscribeform'].elements['attribute5'].value == "") { alert('bitte geben sie das land ein!'); document.forms['subscribeform'].elements['attribute5'].focus(); return false; } else { document.forms['unsubscribeform'].elements['attribute5'].value = document.forms['subscribeform'].elements['attribute5'].value; return true; } } </script>
<?php ob_start(); //$er = error_reporting(0); require_once dirname(__file__) .'/admin/commonlib/lib/unregister_globals.php'; require_once dirname(__file__) .'/admin/commonlib/lib/magic_quotes.php'; ## none of our parameters can contain html $_get = removexss($_get); $_post = removexss($_post); $_request = removexss($_request); $_server = removexss($_server); $_cookie = removexss($_cookie); ## remove trailing punctuation mark on uid if (isset($_get['uid'])) { if (preg_match('/[\.,:;]$/',$_get['uid'])) { $_get['uid'] = preg_replace('/[\.,:;]$/','',$_get['uid']); } } if (isset($_server["configfile"]) && is_file($_server["configfile"])) { include $_server["configfile"]; } elseif (is_file("config/config.php")) { include 'config/config.php'; } else { print "error, cannot find config file\n"; exit; } require_once dirname(__file__).'/admin/init.php'; $globals["database_module"] = basename($globals["database_module"]); $globals["language_module"] = basename($globals["language_module"]); require_once dirname(__file__).'/admin/'.$globals["database_module"]; # load default english , language include_once dirname(__file__)."/texts/english.inc"; if (is_file(dirname(__file__).'/texts/'.$globals["language_module"])) { include_once dirname(__file__).'/texts/'.$globals["language_module"]; } # allow customisation per installation if (is_file($_server['document_root'].'/'.$globals["language_module"])) { include_once $_server['document_root'].'/'.$globals["language_module"]; } include_once dirname(__file__)."/admin/languages.php"; require_once dirname(__file__)."/admin/defaultconfig.php"; require_once dirname(__file__).'/admin/connect.php'; include_once dirname(__file__)."/admin/lib.php"; $i18n = new phplist_i18n(); header('access-control-allow-origin: '.access_control_allow_origin); if (!empty($globals["sessiontablename"])) { require_once dirname(__file__).'/admin/sessionlib.php'; } @session_start(); if (!isset($_post) && isset($http_post_vars)) { require 'admin/commonlib/lib/oldphp_vars.php'; } $req = sql_fetch_row_query(sprintf('select id %s id = %d',$tables["subscribepage"],$id)); $id = $req[0]; $msg = ""; if (isset($_get['p']) && $_get["p"] == "subscribe") { $_session["userloggedin"] = 0; $_session["userdata"] = array(); } if (!$id) { # find default one: $id = getconfig("defaultsubscribepage"); # fix true/false issue if ($id == "true") $id = 1; if ($id == "false") $id = 0; if (!$id) { # pick first $req = sql_fetch_row_query(sprintf('select id %s active',$tables["subscribepage"])); $id = $req[0]; } } $pagedata = array(); if ($id) { $globals['pagedata'] = pagedata($id); if (isset($pagedata['language_file']) && is_file(dirname(__file__).'/texts/'.basename($pagedata['language_file']))) { @include dirname(__file__).'/texts/'.basename($pagedata['language_file']); # allow customisation per installation if (is_file($_server['document_root'].'/'.basename($pagedata['language_file']))) { include_once $_server['document_root'].'/'.basename($pagedata['language_file']); } } } include 'admin/ui/'.$globals['ui'].'/publicpagetop.php'; print $pagedata["header"]; if($_post['email']!='' && isset($_post['email'])) { $email_address = $_post['email']; $query = sprintf('insert %s (email,status) values("%s","%s")', 'phplist_user_unsubscriber',$email_address,"block"); $result = sql_query($query); header("location: unsubscribe.php?m=1"); die(); } if($_get['m']!='' && isset($_get['m'])) { print '<h4 class="pagetitle">you have been unsubscribed our newsletters , receive confirmation message shortly.</h4>'; } if($_get['emailid']=='' && !isset($_get['emailid'])) { print '<h3>'. $globals["strunsubscribeinfo"].'</h3>'; print '<form method="post" action=""><input type="hidden" name="p" value="unsubscribe" />'; print '<p>'.$globals["strenteremail"].': <input type="text" name="email" value="'.$email.'" size="40" /></p>'; print '<input type="submit" name="unsubscribe" value="'.$globals['strcontinue'].'"></form>'; print '<title>'.$globals["strsubscribetitle"].'</title>'; print $pagedata["footer"]; }
?>
this unsubscribe page.there 1 input field email address. n kindly add unsubscribe.php htaccess file..
Comments
Post a Comment