Can I include() a script with a value that is to be determined by a value already set on the page the script is being include() to?
| SitePoint Sponsor |

Can I include() a script with a value that is to be determined by a value already set on the page the script is being include() to?
jmulder[THE MENTOR]'s nice guy online!
Rig: AMD Athlon 800mhz; 384mb SDRam; 32mb nVidia @ 1024x768; ie 6; Windows ME; 15 gig; Cd-RW


yes you can, but make sure that if you reference it from within a function, declare it global

how do i declared global?
how i'm doing this
this above the <html> tag
<? $count = '1'; ?>
<? include ("counter.php"); ?>
variable $count defines the array number in the counter.php
which is
$counter_file_line[$count] ++;
jmulder[THE MENTOR]'s nice guy online!
Rig: AMD Athlon 800mhz; 384mb SDRam; 32mb nVidia @ 1024x768; ie 6; Windows ME; 15 gig; Cd-RW





Well it appears you aren't running a user-defined function in counter.php so you don't need to worry about it.
Please don't PM me with questions.
Use the forums, that is what they are here for.
Bookmarks