I have a TinyMCE inline form which posts to qry.php. The content gets sent over to qry.php with a key of "edit_me". I want the default behavior where the content gets sent using the name attribute.
<script type="text/javascript">
tinymce.init({
selector: '#edit_me',
inline: true
});
</script>
<script type="text/javascript">
$(document).ready( function(){
$('#input_form').ajaxForm({url: 'qry.php', type: 'post'});
});
</script>
<form id="input_form" method="post">
<fieldset name="input" id="edit_me"></fieldset>
<input class="hide" name="form" value="index_s2">
<input type="submit" name="submit" value="Submit">
</form>
Here's my qry.php. I'd like the be able to use "input" instead of the ID.
<?php
require_once('connect.php');
if(isset($_POST['edit_me'])) {
$form = mysqli_real_escape_string($connect, $_POST['form']);
$input = mysqli_real_escape_string($connect, $_POST['edit_me']);
echo $input;
$update_qry = "UPDATE content SET html='{$input}' WHERE section_ID='{$form}'";
if(mysqli_query($connect, $update_qry)){
echo "Records added successfully.";
}
else {
echo "Failed";
}
}
?>
Note that the code works fine as it is, I just don't want it like that.