26-Mar-2015, 09:27 AM
hey folks,
as im modifying the commentics script for my website i have maybe the last problem
i want wo write the email of a person who comments in a seperate db. so i need a extra checkbox for this. no problem, just added this to the includes\template\form.php
Ok, now i want to check this new checkbox and add, if the checkbox is checked, the mail in my own newsletter db. i tried the following:
but it doesn't work. i cant even check if the form is submittet. as im modifying the commentics script for my website i have maybe the last problem
i want wo write the email of a person who comments in a seperate db. so i need a extra checkbox for this. no problem, just added this to the includes\template\form.php
Quote:<div class="cmtx_label"> </div>
<input name="check_newsletter" type="checkbox" class="cmtx_checkbox_field" value="X" />
<span class="cmtx_notify_text">Get Newsletter</span>
Ok, now i want to check this new checkbox and add, if the checkbox is checked, the mail in my own newsletter db. i tried the following:
PHP Code:
<?php
if (isset($_POST['cmtx_submit'])) {
$name = $_POST['cmtx_name'];
$email = $_POST['cmtx_email'];
if (isset($_REQUEST['check_newsletter'])) {
$insert_newsletter = "X";
}
if ($insert_newsletter == "X") {
mysql_query ("INSERT INTO `newsletter` (`name` ,`email`) VALUES ('$name', '$email')");
}
}
PHP Code:
<?php
if (isset($_POST['cmtx_submit'])) {
echo "submitted";
}