<?php

	include "library.php";

    $cxn = start_code();


	if (val( $_POST, "password" ) != "IndieHair12$" )
	{
	    echo black( "<br>Incorrect system password<br><br>" );
	}
    else
    {
        $text = prep_for_sql( val( $_POST, 'text' ) );
    
    
        $query = "UPDATE news SET text = '".$text."' WHERE id = 1";
        
    	$result = run_query( $query, $cxn );
    
    
        echo "<br><br>";
        
        echo black( "Changes saved<br><br>" );
    }
    
    
    echo "<a href='/'>Home page</a>";
    
?>    