Hi;
I'm trying to build a little code-tester page where I have a textbox form into which I enter some code. When I submit it, I want the code to be run on the destination page. (This will save time uploading).
Say I want to pass the following string:
"\$_SESSION[GRAPHARRAY][\$line[NAME]][\$line[TESTPHASE]]=\$line[SCORE]"
So at the top of the destination page you get this:
$GRAPHARRAYSPEC = stripslashes($_POST[GRAPHARRAYSPEC]);
Then later in the script I do something like this:
...while looping through the rows of a MySQL result array to fill a table...
{
echo "<tr>";
foreach ($line as $col_value) {
echo "<td>$col_value</td>";
}
echo "</tr>";
echo "$GRAPHARRAYSPEC"; //fill up the session variables for use in a JpGraph...
}
...continue on to the next row.
"echo" does not seem to be what I want...'cause when I try to print_r($_SESSION[GRAPHARRAY]) at the end of the table, I get nothiing.
The thing works fine if I put the original string in the loop, but the point of this is to submit/test various code possibilities on the fly.
Can what I'm asking be done?
Thanks.