bobtutos
-
Posts
10 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by bobtutos
-
-
Hello every one, today I created the count down timer , but I want to make using OOP style this time. the place where I stuck, is the setTimeout method can't call my class/function every 1000 miliseconds.
Please I need your help, where I mess things up?
Your help is highy appreciate,
Thank you.
Bellow is my code.
<script type="text/javascript">
window.onload = function(){
function ticTock(ddt){
this.currentDate =new Date();
this.dueDate = new Date(ddt);
this.diffDate = this.dueDate.getTime()-this.currentDate.getTime();
if(this.diffDate<=0){
clearTimeout(timer);
document.write("closed")
}
this.seconds = Math.floor(this.diffDate/1000);
this.minutes = Math.floor(this.seconds/60);
this.hours = Math.floor(this.minutes/60);
this.days = Math.floor(this.hours/24);
this.hours %=24,this.minutes %=60,this.seconds%=60;
this.remainder = this.days+'|'+this.hours+"|"+this.minutes+"|"+this.seconds;
var timer = setTimeout(function(){
ticTock(ddt);
},1000);
}
dueDate = "December 25, 2017 00:01:00";
dueDate2 = "December 25, 2019 00:01:00";
var obj = new ticTock(dueDate);
var obj2 = new ticTock(dueDate2);
document.body.innerHTML = obj.seconds;
}
</script> -
Dear all,
Detect whether user is online/offline or typing
I am working with php/mysql,jquery and actual want to advance my php skill,
Now I am interested in doing something similar with fb chat which tells you if the receiver seen your message and it notifies when somebody is typing to you back.
Also I want to detect whether user is online/offline
I know here is the right place to be helped,
if anyone can give me the URL to where this kind of discussion had been made or provide me with tutorial or any hints that could help me to achieve this.
Your helps are highly appreciated
Thank you.
-
Thank you for ur reply,
I will check and test it.
-
Hi everybody!
I would like to ask for your help if it possible, I have a long sting and I want to chop it to small pieces. My string is:-
$longstr = “Str1.htmlstr2.htmlstr3.html”;
And I want the result to be like;
$firstchoppedpiece = “Str1.html”;
$secondchoppedpiece =”Str2.html”;
$thirdchoppedpiece =”Str2.html”;
Is it possible? Or is there any PHP function or method to break it into small pieace?
Your replies are greatly appreciated.
Thank very much.
-
Hi everybody!
I would like to ask for your help if it possible, I have a long sting and I want to chop it to small pieces. My string is:-
$longstr = “Str1.htmlstr2.htmlstr3.html”;
And I want the result to be like;
$firstchoppedpiece = “Str1.html”;
$secondchoppedpiece =”Str2.html”;
$thirdchoppedpiece =”Str2.html”;
Is it possible? Or is there any PHP function or method to break it into small pieace?
Your replies are greatly appreciated.
Thank very much.
-
Thanks 4 the hints and I will try it out.
-
Hello everybody, I do need your help on how to create the database(PHP/MYSQL)with categories and subcategories and which sql command(query) is relevant under this situation?. I tried goggling with no success, so please help me out. Your help is much appreciated. Thanks in advance,
-
-
Populate PHP multidimensional array and add the attributes to the category heading
in PHP
Posted
how to populate PHP multidimensional array and add the attributes to the category heading nodes,
I have the following Books array
$book = array(
"language"=> array("English","Franch","Arabic"),
"Programming"=> array("PHP","JAVA","C++"),
"Science"=> array("Physics","Geography","Math"),
);
function treeView($book){
$markUp = "";
foreach($book as $cate => $subj){
$markUp .= "<li>".((is_array($subj))?$cate.treeView($subj):$subj)."</li>";
}
return "<ul>$markUp</ul>";
}
treeView($book);
//-------------------
The result is what I expected
language
English
Franch
Arabic
Programming
PHP
JAVA
C++
Science
Physics
Geography
Math
I want to do the following (adding class)
<ul>
<li class="language">language
<ul>
<li>English</li>
<li>Franch</li>
<li>Arabic</li>
</ul>
</li>
<li class="Programming">Programming
<ul>
<li>PHP</li>
<li>JAVA</li>
<li>C++</li>
</ul>
</li>
<li class="Science">Science
<ul>
<li>Physics</li>
<li>Geography</li>
<li>Math</li>
</ul>
</li>
</ul>
Your help is highly appreciated
Thank you.