dq13733519262 2014-12-08 07:49 采纳率: 0%
浏览 35

电子邮件订阅频率php mysql

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??

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP