Ok, here's my problem:
$layout = $_POST["layout"];
$space = '"';
$mixed = $space . $layout . $space;
So in the form, $mixed would be $layout with quotes around. That isn't the problem.
$ttitle = '".$row["title"]."';
str_replace('TITLE' , $ttitle , $layout);
and when I type TITLE in the form, it just shows up "TITLE". What's happening?