When you put user input inside a MySQL query you must escape it:
[php]$sql=“INSERT INTO Posts (happening) VALUES (’” . mysql_real_escape_string($_POST[‘happening’]) . “’)”;[/php]
You also post the same select_db command twice:
[php]mysql_select_db(“choward_vicinity”, $con);[/php]
To actually put your new content on the page, you would use file_put_contents. As you’re echoing out this data, you can use output buffering to get PHP to temporarily hold onto everything you output, then you can use this data again:
[php]ob_start();
// All Data for page
$contents = ob_get_contents(); // Get everything collected
ob_end_flush(); // Output everything we’ve buffered
ob_put_contents(‘post.html’, $contents);[/php]
Output Buffering Control (PHP Manual)