₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,324,996 members, 8,419,860 topics. Date: Thursday, 04 June 2026 at 03:52 AM

Toggle theme

Setag's Posts

Nairaland ForumSetag's ProfileSetag's Posts

1 (of 1 pages)

ProgrammingNeed Help With Working With Direcories In PHP by Setag(op): 2:45pm On Feb 05, 2016
I created a director handle
$dp = opendir('.'); //old directory
//changed the directory
chdir("./object"wink; //new diretory

i 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"wink;
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("."wink;
chdir("./object"wink;
$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>";
ProgrammingNeed Help With This Basic Php by Setag(op): 7:41pm On Jan 22, 2016
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).
ProgrammingRe: Help On This Simple Script by Setag(op): 12:57pm On Aug 16, 2015
It worked, saw me mistakes.. Thanks y'all for taking your time..
ProgrammingRe: Help On This Simple Script by Setag(op): 10:21am On Aug 16, 2015
jacob05:
you did not assign value to lbl by mistake.. try indenting your codes too, bugs are, sometimes, easily fixed with proper indentation

function count() {
var lbl = document.getElementById('lbl');
for (i=0; i<10; i++) {
lbl.innnerHTML+= i+'<br>';
}
}



<button type='button' onclick='count()'>start counting </button>
<div id='lbl'></div>
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.
ProgrammingRe: Help On This Simple Script by Setag(op): 10:18am On Aug 16, 2015
jacob05:
you did not assign value to lbl by mistake.. try indenting your codes too, bugs are, sometimes, easily fixed with proper indentation

function count() {
var lbl = document.getElementById('lbl');
for (i=0; i<10; i++) {
lbl.innnerHTML+= i+'<br>';
}
}



<button type='button' onclick='count()'>start counting </button>
<div id='lbl'></div>
ProgrammingHelp On This Simple Script by Setag(op): 6:40pm On Aug 15, 2015
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
ProgrammingHelp On This Simple Script by Setag(op): 6:21pm On Aug 15, 2015
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)