0

我正在尝试集成一个 PHP 函数以将数据库添加到我的文件中以进行跟踪。

这是我的 HTML 代码:-

<div id="" class="wf-formTpl">
<form accept-charset="utf-8" style="margin-top:;" action="https://app.getresponse.com/add_contact_webform.html?u=fgWk" method="post">

                                <input class="wf-input wf-req wf-valid__email" type="text" name="email"
                                data-placeholder="yes" value="Enter Your Email Here" onfocus=" if (this.value == 'Enter Your Email Here') { this.value = ''; }" onblur="if (this.value == '') { this.value='Enter Your Email Here';} " style="margin-top:;"></input>
                         <br />
                                <input type="submit" class="wf-button" name="submit" value="" style="display:  inline !important; margin-top:-10px !important;"></input>

        <input type="hidden" name="webform_id" value="6724404" />


</form>


</div>

<script type="text/javascript" src="http://app.getresponse.com/view_webform.js?wid=6724404&mg_param1=1&u=fgWk"></script>

这是PHP代码:

<?php
$time = $_POST['email'];
if(isset($_POST['submit'])){
 echo '<script type="text/javascript">alert("Done");</script>';
$myFile = "user.html";
    $fh = fopen($myFile, 'w') or die("error");
    $stringData = 'Notification'.$time;
fwrite($fh, $stringData);
};
?>

PHP函数不通过,也就是javascript函数不弹出。我需要一个关于如何做到这一点的帮助:(

该函数运行 HTML 但不运行 PHP 。

提前致谢。

4

0 回答 0