<?php
$submitted = $_POST['submit'];
$post-title= $_POST['post_title'];
$post-content= $_POST['post_content'];
$new_post = array(
'post_title' => '$post-title',
'post_content' => '$post-content',
'post_status' => 'publish',
'post_author' => $user_ID,
);
if(isset($submitted)){
wp_insert_post($new_post);
}
?>
<form method="post" action=" ">
<input type="text" name="post_title" size="45" id="input-title"/>
<textarea rows="5" name="post_content" cols="66" id="text-desc"></textarea>
<input type="hidden" name="cat" value="7,100"/>
<input class="subput round" type="submit" name="submit" value="Post"/>
</form>
I tested it with out the form and it worked fine. but for somereason i cant seem to get it to work with the form. any ideas?
also what is supposed to go in the action for the form?
thanks for the help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…