Support » Fixing WordPress » HTML Form to > New Post

  • I am looking to have a form I have created, use the field values and submit them into a new post..

    I actually want them to create a new topic in bbpress, but it appears bbpress is using the wordpress wp_posts tables anyways. It looks like only the post_type is the difference.

    I have got the form fields to post like this, with 1,2,3,4,5 being the element names.. Although, it will not create a new post or topic doing it this way, so I must be missing something. Any help would be very much appreciated!


    $dbhost  = 'localhost';
    $dbname  = '***';
    $dbuser  = '***';
    $dbpass  = '***'; 
    $con = mysql_connect($dbhost, $dbuser, $dbpass);
    if($con == FALSE)
        echo 'Cannot connect to database' . mysql_error();
        echo 'Connected to database';
    mysql_select_db($dbname, $con);
    $sql="INSERT INTO wp_posts (post_type, post_parent, post_title, post_content, post_author)
    if (!mysql_query($sql, $con))
        die('Error: ' . mysql_error());
    echo "Form Submitted";
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HTML Form to > New Post’ is closed to new replies.