continued : unable to post fields to the next page in php and HTML
<p>So I have fields that are generated dynamically in a different page and then their results should posted to <code>story.php</code> page. fields is going to be : <code>*noun1 *noun2 *noun3</code> and story is going to be : somebody is doing *noun1 etc. What I want to do is to replace <code>*noun1</code> in the story with the <code>*noun</code>, I have posted from the previous page ( I have <code>*noun1</code> posted from the previous page ) but the code below is not working :</p>

<pre><code>$fields = $_POST['fields'];
$story = $_POST['story'];
$fieldsArray = split(' ', $fields);
for ($i = 0; $i &lt; count($fieldsArray); $i++) {
    ${$fieldsArray[$i]} = $_POST[$fieldsArray[$i]];
}

// replace words in story with input
for ($i = 0; $i &lt; count($story); $i++) {
    $thisWord = $story[$i];
    if ($thisWord[0] == '*')
     $story[$i] = ${$thisWord.substring(1)};
}
$tokensArray = split(' ',$tokens);

echo $story;
</code></pre>
