note 68025 added to function.eval
| From: | raul dot gonzalez at laredo dot edu | Date: | Mon, 10 Jul 2006 16:04:56 +0000 |
| Subject: | note 68025 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-114641@lists.php.net to get a copy of this message | ||
I used the slopy example below. Seems to work, it retrieves a list of variables with its respective
values from an Access Database through a form. Then I use eval to use the values from the form and
change them to variables. I am looking for a better method but it does the trick for now. Warning
not to use this method if someone other than you will have access to the HTML form.
<?
$instructor = $_POST['instructor'];
require_once('connection_corral.php'); //LA CONNECTION A LA BASE DE DATOS
echo "<table>";
echo "<th><u>#</u></th>";
echo "<th><u>Student ID</u></th>";
echo "<th><u>Name</u></th>";
echo "<th><u>Times</u></th>";
echo "<th><u>Elapse</u></th>";
$total_records = $_POST['total_records'];
echo "There are " . $total_records . " Records for " . $instructor;
$n = 0;
while ($n < $total_records){
eval($all_records = $_POST['all_records']); //this passes all variables as variables
$total_records = count($CWID); //this counts the number of items in the array
$rs = $conn->Execute("SELECT * FROM WorkFilespring2006 WHERE
CWID = '$CWID[$n]'
AND Inst = '{$instructor}'
AND TutCode <> '070'
AND TutCode <> '080'
AND TutCode <> '010'
AND TutCode <> '011'
ORDER BY vNAME DESC");
$total_hours = 0;
$total_minutes = 0;
$total_seconds = 0;
$i = 0;
while (!$rs->EOF) {
blablabla
$i++;
}
$rs->Close();
?>
----
Server IP: 216.194.113.175
Probable Submitter: 65.116.31.254
----
X-Spam-Status: No, hits=4.0 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_MESSAGE,HTML_TAG_BALANCE_TABLE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.eval.php
Edit -- http://master.php.net/note/edit/68025
Del: integrated -- http://master.php.net/note/delete/68025/integrated
Del: useless -- http://master.php.net/note/delete/68025/useless
Del: bad code -- http://master.php.net/note/delete/68025/bad+code
Del: spam -- http://master.php.net/note/delete/68025/spam
Del: non-english -- http://master.php.net/note/delete/68025/non-english
Del: in docs -- http://master.php.net/note/delete/68025/in+docs
Del: other reasons-- http://master.php.net/note/delete/68025
Reject -- http://master.php.net/note/reject/68025
Search -- http://master.php.net/manage/user-notes.php