Here's the form:
<form id="secursendmsg" action="server.php" method="post">
<div id="body_errors">
</div>
<textarea id="msg_body" name="msg_body'">
</textarea>
<script type="text/javascript">
function showMe (box) {
var chboxs = document.getElementsByName("read");
var vis = "none";
for(var i=0;i<chboxs.length;i++) {
if(chboxs[i].checked){
vis = "block";
break;
}
}
document.getElementById(box).style.display = vis;
}
</script>
<p id="notifycheck" class="notify">
<input type="checkbox" name="read" name="notify" onclick="showMe('notify')"/>
<label for="id_notify">
Enable Read Receipts
</label>
</p>
<div id="notify" style="display:none">
<div id="email_errors">
</div>
<div class="left">
<p>
<label for="email">
Contact email (suggest Anonmail address):
</label>
<br>
<input id="email" type="text" name="sender_email" size="35" rows="3" maxlength="100"/>
</p>
</div>
</div>
<p id="pwrapper">
<div class="button1">
<i class="fa fa-lock"></i> Submit
</div>
<div class="settings">
<i class="fa fa-cog" style="font-size: 20px;">
</i>
</div>
</div>
</form>
My PHP code is below:
<?
if( $_POST )
{
$con = mysql_connect("192.99.xxx.xxx","root","LAxxxxxd!");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("SecurSend", $con);
$sent = $_POST['msg_body'];
$email = $_POST['email'];
$sent = mysql_real_escape_string($sent);
$email = mysql_real_escape_string($email);
$query = "
INSERT INTO `SecurSend`.`SecurMSG` (`email`,`sent`) VALUES ('".$sent."','".$email."');";"
mysql_query($query);
echo "<h2>Test Complete!</h2>";
mysql_close($con);
}
?>
No matter what, I never get the echo, and the information isn't populating. I can't wrap my head around why. The form & PHP isn't hosted on the server, it is hosted in-app via Cordova.