PHP未声明的变量错误

My code and form:

<?php
include("includes/connect.php");
$content = "SELECT * FROM content where content_page='home'";
$result = mysql_query($content);
$row = mysql_fetch_array($result);
?>
<form method="post" action="admin_home.php">
Headline:</br>
<input type="text" name="content_title" value="<?php echo "$row[content_title]" ?>"></br>   </br>
Main content:</br>
<textarea type="text" class="txtinput" cols="55" rows="20" name="content_text"><?php echo   "$row[content_text]" ?></textarea></br></br>
<input type="submit" name="submit" value="Save changes">
</form>

Code for what I want to happen when the 'submit' button is pressed:

<?php 

include("includes/connect.php");
if(isset($_POST['submit'])){ 

$order = "UPDATE content 
          SET content_title='$content_title', content_text='$content_text' WHERE content_page='home'";
mysql_query($order);

}

?>

The error I get:

Notice: Undefined variable: content_title in /Applications/XAMPP/xamppfiles/htdocs/templacreations/admin/admin_home.php on line 63

Notice: Undefined variable: content_text in /Applications/XAMPP/xamppfiles/htdocs/templacreations/admin/admin_home.php on line 63

Line 63 is the following line from my submit button code:

SET content_title='$content_title', content_text='$content_text' WHERE 

is this not declaring them?

It looks like you are looking for the POST values of your form.

They are not contained in the variables $content_title and $content_text. In fact your error is telling you that you haven't assigned anything to those variables.

They are contained in the $_POST array just like the value of the submit.

I.e

<?php 

include("includes/connect.php");
if(isset($_POST['submit'])){ 
  //Sanitize data and assign value to variable 
  $content_title = mysql_real_escape_string($_POST['content_title']); 
  $content_text = mysql_real_escape_string($_POST['content_text']);

  $order = "UPDATE content 
            SET content_title='$content_title', content_text='$content_text' 
            WHERE content_page='home'";
  mysql_query($order);

}

?>