You're not consistent with your quoting style.
When substituting an string-indexed array element in a double-quoted string, you don't need to quote the index:
<?php
$person = array("name" => "Nikolai", "city" => "San Diego");
echo "His name is $person[name]."
?>
That's because within a string, if PHP sees a variable identifier (e.g. $person, $foo) followed by an opening square bracket, PHP assumes that the variable is an array, and that the index is everything up to the first closing square bracket.
This index can either be a number, a string, or another variable. A single-quote mark is an invalid character to begin a simple string index, so PHP throws an error.
To accomodate more complex string or nested indexes, PHP supports the curly-brace syntax. Within curly braces, you must quote all your indexes as if you were not within a double-quoted string.
To make a long story short, you need to either remove the single-quotes from $_POST['text1'], or put $_POST['text1'] in curly-braces.
For more information, I
strongly suggest you read this page:
http://www.php.net/types.string
Take care,
Nik
http://www.bigaction.org/