Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
file_put_contents('newsletter.csv',"$mail\t$name\t".date('Y-m-d H:i:s')."\n",FILE_APPEND);
mail('mymail@mydomain.tld',"New subscription","New subscription arrived from $name with e-mail $mail");
$subscribers = file_get_contents('newsletter.csv');
if (strpos($subscribers,$mail)!==false) {
//abonament
} else {
echo 'You are already subscriber. Thank you!';
}
<link href="subscribe.css" rel="stylesheet" />
<div id="hpSignUp">
<form method="post" name="hpEmSubscrForm" action="/contact/signup" id="hpEmSubscrForm">
<input type="hidden" value="info" name="groups">
<p id="hpEmSubscrForm-p">
</p>
<p>
<label for="hpEmSubscrForm-first" style="display: none;">Име</label>
<input type="text" size="30" value="" id="hpEmSubscrForm-first" name="first_name" class="validate[required] hpEmSubscrForm-inactive">
</p>
<p>
<label for="hpEmSubscrForm-last" style="display: none;">Фамилия</label>
<input type="text" size="30" value="" id="hpEmSubscrForm-last" name="last_name" class="validate[required] hpEmSubscrForm-inactive">
</p>
<p>
<label for="hpEmSubscrForm-email" style="display: none;">Имейл</label>
<input type="text" size="30" value="" id="hpEmSubscrForm-email" name="email_address" class="validate[required,custom[email]] hpEmSubscrForm-inactive">
</p>
<p class="send">
<button id="hpEmSubscrForm-submit" title="Click Here to Register!" type="submit">АБОНИРАЙ СЕ</button>
</p>
</form>
</div>
$first_name = (isset($_REQUEST['first_name'])) ? addslashes($_REQUEST['first_name']) : '';
$last_name = (isset($_REQUEST['last_name'])) ? addslashes($_REQUEST['last_name']) : '';
$mail = (isset($_REQUEST['email_address'])) ? addslashes($_REQUEST['email_address']) : '';
$subscribers = (file_exists('newsletter.csv')) ? file_get_contents('newsletter.csv') : '';
if (strpos($subscribers,$mail)!==false) { // If not already in database
file_put_contents('newsletter.csv',"$mail\t$name\t".date('Y-m-d H:i:s')."\n",FILE_APPEND);
mail('mymail@mydomain.tld',"New subscription","New subscription arrived from $name with e-mail $mail");
}