Jump to content

hisoka

Members
  • Content count

    563
  • Joined

  • Last visited

Everything posted by hisoka

  1. could you explain how ? could you explain this too?
  2. hisoka

    understanding a php code

    very well
  3. hisoka

    understanding a php code

    In this page of I found this little PHP code . I tried to understand it but I could not grasp its meaning to 100% So I will be grateful if you help me understand it : <?php $dir = "/images/"; // Open a directory, and read its contents if (is_dir($dir)){ if ($dh = opendir($dir)){ while (($file = readdir($dh)) !== false){ echo "filename:" . $file . "<br>"; } closedir($dh); } } ?> $dir = "/images/"; is the directory that will be opened and read if (is_dir($dir)) the if condition checks if the directory exists . Please if I am wrong correct me . Now comes the confusion and I have some questions if ($dh = opendir($dir)) 1) the opendir opens a directory handle . What is a handle ? why we need it ? and why we need it to open a directory ? why opendir does not just open a directory and that is all ? what is the difference between opening a directory and opening a directory handle ? 2)if the directory exists then open it . So why do not we put it like this : if (is_dir($dir)){ $dh = opendir($dir) {... why we use another if ? like in : if (is_dir($dir)){ if ($dh = opendir($dir)){ ?? while (($file = readdir($dh)) !== false) The readdir() function returns the name of the next entry in a directory. This is somehow confusing to me . So what does it mean ?? what does it mean while (($file = readdir($dh)) !== false) ?? why false is used here in this context along with the !== ??
  4. Yes but in many cases , I cannot understand what you are writing . By Foxy Mod or Justsomeguy , I understand very well what they mean , my confusion disappeared and I become enlightened but by you not . Whatsoever I did , in many cases , I cannot grasp what you wrote to me . I am only being honest and telling the truth
  5. hisoka

    understanding a php code

    I understand very well . in order for an OS to deal with objects like windows , these objects should be identified . The OS cannot deal with objects if they are not identified to him . A handle is an object identifier or a pointer to that object . In the context of PHP a handle is an object identifier too like files handle , directory handles and so on . If I am wrong correct me why a handle to an open directory should be returned ? True can be returned if the directory is opened or false if it is not opened but why a handle ?
  6. Sorry I did not get a clear answer to my last question :
  7. There is something I could not understand : document.getElementsByTagName('a')[3] gives the third element namely : <a title="HTML Tutorial" class="w3-hide-small" href="/html/default.asp"> but this : var x = document.getElementsByTagName('a')[3]; console.log(x); gives : object {} although all what I did is assigning document.getElementsByTagName('a')[3] to a variable . So I am wondering why ? why the result is different ?
  8. This is enough document.getElementsByTagName('a')[3].innerHTML = "CSS"; and the innerHTML of the third element will be changed to CSS and so on . The changing is apparent and temporary but once the page is refreshed , the default setting turn back .
  9. <a target="_top" href="default.asp">JS HOME</a> <a target="_top" href="js_intro.asp">JS Introduction</a> <a target="_top" href="js_whereto.asp">JS Where To</a> <a target="_top" href="js_output.asp">JS Output</a> <a target="_top" href="js_syntax.asp">JS Syntax</a> element.innerHTML = new html content change the inner HTML of an element . So I would like to change JS HOME to JS HOUSE . I did it like this : a.JS HOME = JS HOUSE but there was an error saying : what was that error and how to change the inner HTML from JS HOME to JS HOUSE ??
  10. You know bro that I am in the beginning of the path . I am struggling to understand especially that no one learned me programming and I am doing it all myself . I am new .
  11. You are affirming what I wrote namely that : document.getElementById(id) returns an element object meanwhile (single) document.getElementsByTagName(name) returns an array of elements or a collection of elements ( plural)
  12. That is very complicated and not 100% true and exact document.getElementById(id) gives an element by id and not as you wrote to me meanwhile this : document.getElementsByTagName(name) gives an array of elements by Tag name . To prove what I write here is what document.getElementById('nav_tutorials') gives : a single element <div class="w3-dropnav w3-light-grey w3-card-2 w3-center" id="nav_tutorials" style="display: none;"> and here what document.getElementsByTagName('a') gives : an array containing more than 241 elements HTMLCollection [ <a.w3schools-logo>, <a.topnav-localicons.w3-hide-large.w3-left>, <a.topnav-icons.fa.fa-home.w3-left>, <a.w3-hide-small>, <a.w3-hide-small>, <a.active>, <a.w3-hide-small>, <a.w3-hide-small>, <a.w3-hide-small>, <a.w3-hide-small>, 241 more… ] it is single against plural .
  13. Exactly this document.getElementsByTagName(name) gives an array of elements , specified by the tag name between the opening and closing parentheses , as its values . It does not give a raw element like document.getElementById(id) does
  14. OK suppose I have a webpage with a submit form and using JavaScript , I must do the following : 1) multiple 40 with 2 2) put the result in the submit form box 3)click submit to send the result to the server . The result that is 80 should be returned in one second manually , I cannot send the form in one second . So I would like to know How to do it in one second using JavaScript ? and/or what is the tool to do it ?
  15. get an element by its id . If I do not know the id I cannot get its element . Totally logical and true Foxy Mod . Then how to get the id ? or what is the method used to get an id ? For example how to get the id in this page ?
  16. I will reformulate my question : now I am in this page http://w3schools.invisionzone.com/index.php?showtopic=55183&hl= and I want to find , in this page , an element by its id using document.getElementById(id) method . So how to do it ?
  17. hisoka

    mysql ditching

    I would like to know what is the exact meaning of " MySQL ditching " ?? as the word ditching , when used with MySQL confuses me .
  18. hisoka

    mysql ditching

    This is a context : http://www.parityportal.com/2013/06/18/red-hat-says-nothing-decided-about-ditching-mysql-move-to-mariadb/ in this context what does it mean ?
  19. I am now reading carefully but I need to ask some questions in between . This is a source code : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!--[if IE 6]> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" class="lteIE6"> <![endif]--> <!--[if IE 7]> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" id="ie7"> <![endif]--> <!--[if !(IE 6) & !(IE 7)]><!--> <html lang="en"> <!--<![endif]--> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Local file inclusion | DDXhunter, Hack 'n Web</title> <link rel="pingback" href="https://ddxhunter.wordpress.com/xmlrpc.php" /> <link rel="alternate" type="application/rss+xml" title="DDXhunter, Hack 'n Web » Feed" href="https://ddxhunter.wordpress.com/feed/" /> <link rel="alternate" type="application/rss+xml" title="DDXhunter, Hack 'n Web » Comments Feed" href="https://ddxhunter.wordpress.com/comments/feed/" /> <link rel="alternate" type="application/rss+xml" title="DDXhunter, Hack 'n Web » Local file inclusion Category Feed" href="https://ddxhunter.wordpress.com/category/web-hacking/local-file-inclusion/feed/" /> <script type="text/javascript"> /* <![CDATA[ */ function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function () { oldonload(); func(); } } } /* ]]> */ </script> <link rel='stylesheet' id='all-css-0' href='https://s0.wp.com/_static/??-eJx9j90KwjAMhV/IGvzFXYjPsnaxq0uWsqaMvb2dIoKT3YTkcD5ODozROOkVewXOJlL2oU8wRidsEgfC6efaupQ28B+j0GGCB2qsXWde18JuSfwXEO+xkazmLkQywhgaj7qW4WTAonOsdXYwNqFGQi62NYzj+UPNa1seXK3y7mxtHDAlUyaHzEbbErTk3jLEbIGlyVQPQafSXxGSToQzcOPr7niq9sdddbg8nkinjQs=''>https://s0.wp.com/_static/??-eJx9j90KwjAMhV/IGvzFXYjPsnaxq0uWsqaMvb2dIoKT3YTkcD5ODozROOkVewXOJlL2oU8wRidsEgfC6efaupQ28B+j0GGCB2qsXWde18JuSfwXEO+xkazmLkQywhgaj7qW4WTAonOsdXYwNqFGQi62NYzj+UPNa1seXK3y7mxtHDAlUyaHzEbbErTk3jLEbIGlyVQPQafSXxGSToQzcOPr7niq9sdddbg8nkinjQs=' type='text/css' media='all' /> <link rel='stylesheet' id='screenprojection-css-1' href='https://s1.wp.com/wp-content/themes/pub/modularity-lite/library/styles/screen.css?m=1289600476h' type='text/css' media='screen, projection' /> <link rel='stylesheet' id='print-css-2' href='https://s1.wp.com/wp-content/themes/pub/modularity-lite/library/styles/print.css?m=1361549426h' type='text/css' media='print' /> <!--[if lte IE 8]> <link rel='stylesheet' id='modularity-ie-css' href='https://s0.wp.com/wp-content/themes/pub/modularity-lite/library/styles/ie.css?m=1276553573h&ver=4.5.1' type='text/css' media='all' /> <![endif]--> <!--[if lte IE 7]> <link rel='stylesheet' id='modularity-ie-nav-css' href='https://s0.wp.com/wp-content/themes/pub/modularity-lite/library/styles/ie-nav.css?m=1276553573h&ver=4.5.1' type='text/css' media='all' /> <![endif]--> <link rel='stylesheet' id='all-css-7' href='https://s1.wp.com/_static/??-eJx9i1EKwkAMRC/kGgor6od4lu0S05RsUpotXt+VQqko/gwzzHvwnEI2ragVyhImWYjVAYuNvOYxux+AQa1yI30r6/HbJ7QgllNl048RHpJ4/qfO2ItRqwSN2s0vqQ5Y0GGIQGJ9kjdwL7cunq4xXs5dHF9ualHF' type='text/css' media='all' /> <script type='text/javascript'> /* <![CDATA[ */ var LoggedOutFollow = {"invalid_email":"Your subscription did not succeed, please try again with a valid email address."}; /* ]]> */ 1)why is some HTML between <--> ? document.getElementById(id) is used to find element by element id . So I applied it on the source code above like this : document.getElementById('ie7') but it gives null as a result ? why ? then document.getElementById('all-css-0') gives me this : <link media="all" type="text/css" href="https://s0.wp.com/_static/??-eJx9j90KwjAMhV/IGvzFXYjPsnaxq0uWsqaMvb2dIoKT3YTkcD5ODozROOkVewXOJlL2oU8wRidsEgfC6efaupQ28B+j0GGCB2qsXWde18JuSfwXEO+xkazmLkQywhgaj7qW4WTAonOsdXYwNqFGQi62NYzj+UPNa1seXK3y7mxtHDAlUyaHzEbbErTk3jLEbIGlyVQPQafSXxGSToQzcOPr7niq9sdddbg8nkinjQs=" id="all-css-0" rel="stylesheet"> why it gives me that whole stuff . It should give me only as I asked only for the element id="all-css-0" ??? One last question document.getElementById(id) is used to find an element by element id . What if I cannot access the source code or I want to find an element by its id without accessing the source code . So for example how can I use document.getElementById() to access the 'all-css-0' element without seeing the source code ???
  20. hisoka

    mysql ditching

    So , if I understand what is mentioned in the dictionary very well , they're ditching MySQL in favor of PostgreSQL means that they replaced MySQL database with PostgreSQL? right ?
  21. hisoka

    mysql ditching

    yes that is what I meant what does it mean "they're ditching MySQL in favor of some other database" ? the word ditching confuses me
  22. document.getElementById('form_field').value = 40 * 2; document.getElementById('form').submit(); what if there is no id ? how it will be submitted ?
  23. I misunderstood the word delay and thanks to what you wrote Foxy Mod I understood what it means . It is like a bomb . You set a time for it after which it will automatically explode . You can set a time of 30 seconds or 10 seconds or 5 seconds .
  24. hisoka

    a compiler for java

    thank you
×