Setag's Posts
Nairaland Forum › Setag's Profile › Setag's Posts
1 (of 1 pages)
I created a director handle $dp = opendir('.'); //old directory //changed the directory chdir("./object" ; //new diretoryi expect the code I write that list files in the new directory but it listed all files in old directory. Now, if $dp = opendir("./object" ;I write a code that lists all files in this directory it does, but the links don't work well; it thinks my files reside in the old folder Here's the code: $dp = opendir("." ;chdir("./object" ;$currentfile = ""; while ($currentfile !== false) { $currentfile = readdir($dp); $filesarray[] = $currentfile; } print "<ul>"; foreach ($filesarray as $afile) { print "<li><a href = \"$afile\">$afile</a></li>"; } print "</ul>"; |
Let's say we're gonna be rolling a die: $die = rand(1, 6); Whilst the die is being rolled (the value of $die remains the same till user makes the right guess), the user tries to guess the value of the die. Program tells the user if the guess is higher (or lower) than the die value if guess is incorrect, program tells user how many times it took to guess the value of the die right if it took more than one turn to make the right guess. Immadiately user gets it right, game starts over again(the die is rolled again). |
It worked, saw me mistakes..
Thanks y'all for taking your time.. |
jacob05:sorry, the code is properly indented on the editor. My mistake here, but on the real script, I initiated the var and assigned value to it.. I keep getting the same error. I will check it out and get back. |
jacob05: |
Function count() {
var lbl;
document.getElementById('lbl');
for (i=0; i<10; i++) {
lbl.innnerHTML+= i+'<br>';
}
} the tags specifically: <button type='button' onclick='count()'>start counting </button> <div id='lbl'></div> i keep getting this error on IE: unable to get property 'innerHTML' of undefined or null reference. Kinda help fix this and explain.. Cc: dhtml |
Function count() {
var lbl= document.getElementById('lbl');
for (i=0; i<10; i++) {
lbl.innnerHTML+= i+'<br>';
}
} the tags specifically: <button type='button' onclick='count()'>start counting </button> <div id='output'></div> i keep getting the this error on IE: unable to get property 'innerHTML' of undefined or null reference. Kinda fix this and explain.. Re: dhtml |
1 (of 1 pages)
; //new diretory