Alright guys, I've posted a lot today... and I still have a long way to go. Basically i'm working on a term project that needs to have one fully functional DB/PHP feature. I have chosen a subscription feature that allows the "client" to receive updates on new products via form subscription.
So far, I have the form set up to where it submits the information to the DB... but I do not have it set up to email the client based on their selection of frequency updates. I know I need to make a table with the products, which will be done. The big issue i'm going to have is how do I make this work? How do I make this feature work so that when a new product is submitted it will send the client an email of new products that have arrived based on the selection they choose... daily update/weekly update/monthly update. I will post what I have thus far, this is a new horizon for me... will take any help I can get.
here is my html:
<form action="form.php" method="POST">
<div class="row">
<div class="large-4 columns">
<span id="spryfirstname">
<input name="firstname" type="text" class="text" placeholder="First Name"/>
<span class="textfieldRequiredMsg">A value is required.</span></span>
</div>
<div class="large-4 columns">
<span id="sprylastname">
<input name="lastname" type="text" class="text" placeholder="Last Name"/>
<span class="textfieldRequiredMsg">A value is required.</span></span>
</div>
<div class="large-4 columns">
<div class="row collapse">
<div class="small-9 columns">
<span id="spryemail">
<input name="email" type="text" placeholder="email@example.com"/>
<span class="textfieldRequiredMsg">A value is required.</span</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<label>Check all Products that you're interested in</label>
<div>
<input name="products[]" type="checkbox" value="all">ALL PRODUCTS/SERVICES</label>
<input name="products[]" type="checkbox" vallue="trade"><label>Trade-in</label>
<input name="products[]" type="checkbox" value="layaway"><label>Layaway products</label>
<input name="products[]" type="checkbox" value="theatre"><label>Home Theatre Systems</label>
<input name="products[]" type="checkbox" value="TV"><label>HD TVs</label>
<input name="products[]" type="checkbox" value="Games"><label>Video Game Consoles</label>
<br>
<input name="products[]" type="checkbox" value="laptops"><label>Laptops</label>
<input name="products[]" type="checkbox" value="monitors"><label>Monitors</label>
<input name="products[]" type="checkbox" value="phones"><label>Phones</label>
<input name="products[]" type="checkbox" value="cameras"><label>Cameras</label>
<input name="products[]" type="checkbox" value="acoustic"><label>Acoustic Guitars</label>
<input name="products[]" type="checkbox" value="electric"><label>Electric Guitars</label>
<input name="products[]" type="checkbox" value="drums"><label>Drums</label>
<input name="products[]" type="checkbox" value="wind"><label>Wind Instruments</label>
<br>
<input name="products[]" type="checkbox" value="pianos"><label>Pianos</label>
<input name="products[]" type="checkbox" value="violins"><label>Violins</label>
<input name="products[]" type="checkbox" value="diamonds"><label>Diamonds</label>
<input name="products[]" type="checkbox" value="neck"><label>Necklaces</label>
<input name="products[]" type="checkbox" value="rings"><label>Rings</label>
<input name="products[]" type="checkbox" value="ear"><label>Ear Rings</label>
<input name="products[]" type="checkbox" value="gold"><label>Gold Jewelry</label>
<input name="products[]" type="checkbox" value="silver"><label>Silver Jewelry</label>
<hr>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<label>How often would you like to have product updates?
<select>
<option value="daily" name"Updates">Daily</option>
<option value="weekly" name"Updates">Weekly</option>
<option value="monthly" name"Updates">Monthly</option>
</select> </label>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<label>Tell us a little about yourself<textarea placeholder="Type here"></textarea> </label>
</div>
</div>
<div class="row">
<input class="button small large-3" type="submit" name"submit" />
</div>
here is my connection to the DB and my PHP:
if(isset($_POST['submit'])){
$con = mysqli_connect("localhost","dxh6110","tcqfoz7","dxh6110")
or die("Error " . mysqli_error($con));
$first = stripslashes($_POST['firstname']);
$last = stripslashes($_POST['lastname']);
$email = stripslashes($_POST['email']);
$checkbox = stripslashes($_POST['products']);
$update = stripslashes($_POST['updates']);
$first = mysqli_real_escape_string($con,$_POST['firstname']);
$last = mysqli_real_escape_string($con,$_POST['lastname']);
$email = mysqli_real_escape_string($con,$_POST['email']);
$checkbox = mysqli_real_escape_string($con,$_POST['products']);
$checkbox = mysqli_real_escape_string($con,$_POST['updates']);
$checkbox = implode(',', $_POST['products']);
$sql = "INSERT INTO Register (First,Last,Email,Product,Updates)
VALUES('".$first."','".$last."','".$email."','".$checkbox."','".$update."')";
}
mysqli_query($con,$sql);
mysqli_close($con);
?>
is this possible??