Forum Moderators: open
It was only an editor, not a full app as I am attempting to flesh it out to be.
Here is the form that I have with it so far, modified ofcourse:
<form name="Blog_post" onSubmit="editor1.prepareSubmit()" method="post">
<p><b>Title:</b>
<input type=text name="title" id="post_title " size="40">
</p>
<p> Type or paste your message below:</p>
<?php echo"<script type='text/javascript'>
var editor1 = new WYSIWYG_Editor('editor1');
editor1.display();
</script>
"; ?>
<input type="hidden" name="post_date" value="<?php echo '$timestamp'?>">
<br>
<input type="submit" name="Submit" value="Post Blog">
</p>
</form>
Here is the second form from the edit file to update the information from the previous form:
<form name="Blog_edit" onSubmit="editor1.prepareSubmit()" method="post">
<p><b>Title:</b>
<input type=text name="title" size="40">
</p>
<p> Type or paste your message below:</p>
<?php echo"<script type='text/javascript'>
var editor1 = new WYSIWYG_Editor('editor1','<?php echo '$content' ?>');
editor1.display();
</script>
"; ?>
<input type="hidden" name="sub date" value="<?php echo '$timestamp'?>">
<br>
<input type="submit" name="Submit" value="Post Blog">
</p>
</form>
I have a content variable as saving the data in the body of the editor but, as you can see, I don't know what nor where to call the submission from the editor to push the data to the database.
Can someone please advise how to connect these to my database on pass of the submit button?
I am trying to use this form for me own article posting script for a project.
<?php echo $content; ?>
Also, where is the $content variable being set? I think you'll want to have something like this higher up in the script:
<?php
$content = addslashes(preg_replace('`[\r\n]`','\n',$_POST['editor1_content']));
?>
As far as how to access posted variables, the best thing to do is to add this line to your code for debugging so you can see what's being posted:
<?php print_r($_POST); ?>
HTH :)