Re: grabbing variable from bottom to top
| From: | Jeff Harris | Date: | Mon, 04 Aug 2003 06:34:40 +0000 |
| Subject: | Re: grabbing variable from bottom to top | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158120@lists.php.net to get a copy of this message | ||
On Aug 3, 2003, "Micah Montoy" claimed that:
|Anyone know of a way to use a variable that isn't defined until further down
|the script at the top. I have a counter and once everything runs through
|the script, the count is complete, I need to display this at the top above
|the displayed results. I thought about and tried a function but I still run
|into the same problem.
|
|thanks
You could use some dHTML. At the top of the page, you would print
something like
<p ID="CountingID">Calculating count.</p>
Then, after the computing,
<SCRIPT LANGUAGE="JavaScript">
document.all("MyID1").innerText = 'Total Count: $count.';
</SCRIPT>
This code is probably very browser dependant, so YMMV.
Jeff
--
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc |
gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.