I have got the following code:
Code: Select all
if ( isset( $_POST ) )
$postArray = &$_POST; // 4.1.0 or later, use $_POST
else
$postArray = &$HTTP_POST_VARS; // prior to 4.1.0, use HTTP_POST_VARS
foreach ( $postArray as $sForm => $value )
{
if ( get_magic_quotes_gpc() )
$postedValue = htmlspecialchars( stripslashes( $value ) ) ;
else
$postedValue = htmlspecialchars( $value ) ;
$user='user';
$host='localhost';
$password='password';
$database='database';
$con=mysqli_connect($host, $user, $password, $database)
or die ("Error 201: The SQL Server could not be contacted at this time. please try agian or if the problem persists contact Luke Frost");
$query = "UPDATE oc_message SET Content = '" . $postedValue . "', OC_Name = '" . $_POST['OC_Name'] . "' WHERE URN = 1";
$result=mysqli_query($con, $query)
or die ("Error 202: The 332 Sqn SQL Server could not be contacted at this time. please try agian or if the problem persists contact Luke Frost");
echo "Home Page has been updated successfully to the following information:<br><br>";
echo "<strong>OC's Message</strong><br>";
echo $postedValue;
echo "<br><br><strong>OC's Name</strong><br>";
echo $_POST['OC_Name'];
echo "<br><Br>Page will redirect automatically after 5 seconds.<br>";
echo "If the page does not refresh click <a href='../WebsiteAdmin_Webpages.php'>here</a>";
}What am I doing wrong and how can i stop this happening and just saving the textarea class contents?
Thank you in advance
Frosty