0

I'm trying to integrating a PHP function to add the database into my file for tracing out purpose.

Here's my HTML code :-

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

Here's the PHP code :

<?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);
};
?>

The PHP function doesn't go through , a.k.a the javascript function doesn't pops up. I need a favor on how to make this happen :(

The function runs the HTML but not the PHP .

Thanks in advance.

McKin
  • 5
  • 4

0 Answers0