Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,685 members, 7,816,796 topics. Date: Friday, 03 May 2024 at 05:18 PM

Setag's Posts

Nairaland Forum / Setag's Profile / Setag's Posts

(1) (of 1 pages)

Programming / Need Help With Working With Direcories In PHP by Setag: 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>";
Programming / Need Help With This Basic Php by Setag: 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).
Programming / Re: Help On This Simple Script by Setag: 12:57pm On Aug 16, 2015
It worked, saw me mistakes.. Thanks y'all for taking your time..
Programming / Re: Help On This Simple Script by Setag: 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.
Programming / Re: Help On This Simple Script by Setag: 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>
Programming / Help On This Simple Script by Setag: 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
Programming / Help On This Simple Script by Setag: 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)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 21
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.