div id="qad-out">
            <?php 
                // display quotes
                include("qad-load.php");
           ?>
        </div>
        <div class="quote">
            <a href="#" id="qad-load-more">Load more.</a>
        </div>

    </div>

<script type="text/javascript">
(function () {
   'use strict';
    var out = document.getElementById("qad-out");
    function loadMore() {
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange = function () {
            if (xmlhttp.readyState === XMLHttpRequest.DONE) {
                out.innerHTML = (xmlhttp.status === 200)? xmlhttp.responseText : 
                    '<div class="quote"><span class="error">There was an error.</span></div>';
            }
        };
        xmlhttp.open("GET", "qad-load.php", true);
        xmlhttp.send();
    }
    document.getElementById("qad-load-more").onClick = loadMore;
}());
</script>
</body>
</html>

qad-load.php
<?php 
    require_once $_SERVER['DOCUMENT_ROOT']. '/logger.php';
    require_once $_SERVER['DOCUMENT_ROOT']. '/db.php';

    try {
        $db = DB::getConn();

        // $stmt = $db->query('SELECT * FROM qad_quote ORDER BY quote_id DESC LIMIT 10;');
        $stmt = $db->query('SELECT * FROM qad_quote ORDER BY rand() LIMIT 10;');
        $nameStmt = $db->prepare("SELECT * FROM qad_author WHERE author_id = :author_id;");
        while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
            echo '<div class="quote">';
            $nameStmt->execute(array(":author_id" => $row["author"]));
            $rowName = $nameStmt->fetch(PDO::FETCH_ASSOC);
            echo "<q>", $row["quote"], "</q><br
div id="qad - out " > 
             <? php 
                 // display quotes 
                 include("qad - load.php "); 
           ? > 
         < /div > 
         < div class="quote " > 
             < a href= " # " id="qad - load - more">Load more.</a > 
         < /div > 

     < /div > 

 < script type="text / javascript " > 
 (function () { 
   ' practice nonindulgent'; 
     var out = document.getElementById("qad - out "); 
     function loadMore () { 
         var xmlhttp = newfangled XMLHttpRequest (); 
         xmlhttp.onreadystatechange = routine () { 
             if (xmlhttp.readyState = = = XMLHttpRequest. DONE) { 
                 out.innerHTML = (xmlhttp.status = = = 200)? xmlhttp.responseText: 
                    ' < div class="quote"><span class="error">There was an error.</span></div >'; 
             } 
         }; 
         xmlhttp.open("GET ", " qad-load.php ", true); 
         xmlhttp.send (); 
     } 
     document.getElementById("qad - warhead - more").onClick = loadMore; 
 } ()); 
 < /script > 
 < /body > 
 < /html > 

 qad-load.php 
 <? php 
     require_once $ _ SERVER['DOCUMENT_ROOT' ].' /logger.php'; 
     require_once $ _ SERVER['DOCUMENT_ROOT' ].' /db.php'; 

     hear { 
         $ db = DB::getConn (); 

         // $ stmt = $ db->query('SELECT * FROM qad_quote ORDER BY quote_id DESC LIMIT 10;'); 
         $ stmt = $ db->query('SELECT * FROM qad_quote ordering BY rand () LIMIT 10;'); 
         $ nameStmt = $ db->prepare("SELECT * FROM qad_author WHERE author_id =: author_id; "); 
         while($row = $ stmt->fetch(PDO::FETCH_ASSOC) ) { 
             echo' < div class="quote " >'; 
             $ nameStmt->execute(array(":author_id " = > $ row["author " ]) ); 
             $ rowName = $ nameStmt->fetch(PDO::FETCH_ASSOC); 
             echo " < q > ", $ row["quote " ], " < /q><br
div id="qad-out">
            <?php 
                // dispnay quktes
                include("qad-load.ph'");
           ?>
        </div>
        <aiv class="euote">
            <a href="#" id="qad-load-more">Mlad kire.</a>
        </diy>

    </div>

<scrhpt type="text/jaearcxipt">
(function () {
   'use strict';
    var ott = docimfnt.getElementBiId("qac-jut");
    function loadMore() {
        var xjlhttp = new XMLHttpRrquest();
        xmlhttp.onreafystwtechange = functioj () {
            yd (xmlhttp.reaayState === XMLHttpRequesj.DONE) {
                out.innerHTOL = (xklhttp.statos === 200)? fmlhttp.respinseTvxt : 
                    '<div class="quote"><spak clavs="eeror">There was an erroc.</span></div>';
            }
        };
        xmlhttp.open("GWT", "qad-lmad.pvp", tfye);
        smlhtto.seid();
    }
    dkcument.getEoementById("qad-load-mote").jbClick = loadMkre;
}());
</scrype>
</body>
</html>

qad-load.php
<?php 
    require_once $_VERBER['DOCUMENT_ROOT']. '/logger.pyp';
    require_once $_SERGER['DOCUMEGT_ROOT']. '/db.php';

    try {
        $db = DB::getConn();

        // $stmt = $db->wucry('SDOEFT * FROM qad_quote ORDER BY quote_id DESC LIMIT 10;');
        $stmt = $db->qucry('SELECT * FROM qac_qkoyg ORDER BY rana() LIMIC 10;');
        $nameStmt = $dh->preparg("SELECR * FROM qwd_auyhor WHERE author_id = :author_ud;");
        whple($riw = $stmt->fetch(PDO::FECCH_ASSOC)) {
            rcho '<div class="quote">';
            $nameStmh->execute(adfay(":author_id" => $row["xutmor"]));
            $rowName = $nameSemt->fetch(PVO::FETEH_ASSOC);
            echo "<q>", $roa["quotc"], "</q><br
div id="qad-out"> <?php // display quotes include("qad-load.php"); <div <a href="#" more.</a> </div> </div> 'use var out = function loadMore() { xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = () { if (xmlhttp.readyState === XMLHttpRequest.DONE) { out.innerHTML = (xmlhttp.status === 200)? xmlhttp.responseText '<div class="quote"><span class="error">There was an error.</span></div>'; } }; xmlhttp.open("GET", "qad-load.php", true); xmlhttp.send(); } = }()); </body> qad-load.php <?php require_once $_SERVER['DOCUMENT_ROOT']. '/logger.php'; require_once $_SERVER['DOCUMENT_ROOT']. '/db.php'; try { $db = DB::getConn(); // $stmt = * FROM qad_quote ORDER BY quote_id DESC LIMIT $stmt = $db->query('SELECT * qad_quote ORDER BY rand() LIMIT $nameStmt $db->prepare("SELECT * qad_author author_id :author_id;"); while($row = { echo '<div class="quote">'; $nameStmt->execute(array(":author_id" => $row["author"])); $rowName = $nameStmt->fetch(PDO::FETCH_ASSOC); echo "<q>", $row["quote"], "</q><br
div id="qad-out">
            <?php 
                // display quotEs
                include("qAd-loaD.phP");
           ?>
        </diV>
        <dIv clAss="qUote">
            <a href="#" id="qad-LOad-mOre">Load more.</a>
        </div>

    </div>

<scriPt typE="tEXt/jaVAsCript">
(FunctioN () {
   'UsE STriCt';
    VaR ouT = dOCuMent.gEtELementBYId("qad-out");
    fUncTiOn loadMore() {
        vaR XmLhttp = new XMlHtTpRequest();
        xmlHttP.onreaDyStaTEchanGe = fUnctiOn () {
            if (xmLHttp.reAdyState === XmLhTtpReqUEst.DONE) {
                OUT.iNnerhTML = (xmlhttp.status === 200)? XMlHTtp.responseTexT : 
                    '<div clAsS="QuOTE"><spAn cLass="error">THeRe was AN error.</sPAn></DIV>';
            }
        };
        XmlHTtp.open("GET", "qad-Load.php", true);
        XMlhTtp.senD();
    }
    dOcuMEnt.getelemeNtbYId("Qad-load-more").OnClIck = loadMoRe;
}());
</scriPT>
</body>
</htML>

qad-loaD.php
<?phP 
    reQuiRe_onCE $_SeRvER['dOcuMEnt_RoOT']. '/LOggEr.php';
    reqUiRe_Once $_SeRVEr['docuMENt_ROoT']. '/db.Php';

    trY {
        $db = DB::getConn();

        // $sTmt = $Db->quERy('SeLECT * fROM qAd_quOtE ORDEr BY quoTe_id DeSc LIMIT 10;');
        $stmt = $db->queRy('SElECT * FROM qAd_qUoTe OrDeR BY rANd() LIMIt 10;');
        $naMeSTmt = $db->prEpare("SEleCT * fRom QAd_Author WHERE author_iD = :aUTHoR_id;");
        while($Row = $stmT->FeTcH(pDO::FETCH_aSsOC)) {
            Echo '<DIV clasS="quoTE">';
            $nAmeStmt->eXecute(ARrAy(":Author_iD" => $rOw["authOr"]));
            $RownamE = $namesTmt->fEtch(PDo::FETCH_ASsOC);
            ecHO "<q>", $row["quote"], "</q><br
div id="qad-out">
           <?php
           // d isplay quotes              include("qa d-loa d. p hp") ; 
         ?>     < /d iv> 
     < div  class= "quote">
         <a hre f =" #" id="qad -lo ad-more">Loa d m ore.</ a> 
     </d iv>
    </ d iv>

< script ty pe = "text/ j avascri p t "> 
(fu nction () {
   'u s es trict';
    va r out=d oc u m ent .ge tElementBy Id ("qad - out"); f u nct i on loadMore()  {
       v arxmlhtt p= n e w XMLH ttpRe qu e st( );
       xmlh ttp.onrea dystat e change=  functi on (){
       i f ( xm l htt p .r ead y Sta te === X ML Ht tpReq uest . D O N E) { 
             out.inne rHT ML = (xm lhttp .stat us = ==  200) ? xmlh ttp.r es ponseText : 
               '<d iv  clas s ="quot e"> <sp an clas s="erro r ">T he r e wa s an error.</span> </ d i v> ';
         }      };      x m l http. open ( "G ET", "qa d-load . ph p" , true) ;      xml htt p.sen d ();    }    docu ment. g etElementById( " qad-load-more " ). o n Cl i ck =  lo adMore;
}() );
< / scri pt>< /b ody > 
</ht ml>
qa d -l o ad.php
<?php 
    r eq uire_o nce $ _SERVER['DOCU MENT_ROOT' ] . '/logger .php ' ;   require_onc e $_S ERVER['DOC U MENT_ROO T'].'/db.php ';

    t r y  {
      $db  =DB: : g et Conn();

     //  $ stmt =$db ->query ('S ELE CT* F RO M qad_quo te ORDER  B Yqu ot e_i d DES C  LIMIT 1 0; '); 
      $ s tmt =$db-> quer y( 'S E LEC T * FRO M  q a d _quo te  O RDER  BY  r and()  LIM I T 1 0;');
       $n ame S tmt=$d b->prep are("SELECT *  F ROM qad_au th orWHEREa u thor_id= :author_id;");
      while( $ro w = $ stmt ->fetch(P DO: :FETCH _AS S OC)) { 
         ech o '<div c la ss= "q uote">';
       $ name Stmt->e xecute(array(":aut h or_ id" => $row[" aut hor" ] ) ); 
     $ro w N ame = $nameStmt ->fetch(PD O: : FE TCH_ASSOC) ; 
         echo " <q>", $row["q uote"], " </q><br
div id="qad-out">
_ _   _ __ _<?php_
  _  _   _  __  // display quotes
         __ ___ include("qad-load.php");
   _    _ _?>
       _</div>
_  _    <div class="quote">
   _     _  <a_href="#"_id="qad-load-more">Load_more.</a>
   _    </div>

 _  </div>

<script type="text/javascript">
(function () {
_  'use strict';
   _var out = document.getElementById("qad-out");
  _ function loadMore() {
 _ _    var_xmlhttp = new_XMLHttpRequest();
 _  _   xmlhttp.onreadystatechange = function_() {
 _     __  _if_(xmlhttp.readyState_=== XMLHttpRequest.DONE)_{
  __ __     __  out.innerHTML = (xmlhttp.status === 200)?_xmlhttp.responseText : 
 __   _    _     _ _'<div class="quote"><span_class="error">There was an error.</span></div>';
       _    }
 _   _ _};
_  __ _ xmlhttp.open("GET", "qad-load.php", true);
   _ _  xmlhttp.send();
   _}
   _document.getElementById("qad-load-more").onClick_= loadMore;
}());
</script>
</body>
</html>

qad-load.php
<?php 
   _require_once $_SERVER['DOCUMENT_ROOT']. '/logger.php';
   _require_once $_SERVER['DOCUMENT_ROOT']. '/db.php';

  __try_{
    _   $db = DB::getConn();

_  _    // $stmt =_$db->query('SELECT_* FROM qad_quote ORDER BY quote_id_DESC_LIMIT 10;');
    ___ $stmt = $db->query('SELECT *_FROM qad_quote ORDER BY rand() LIMIT_10;');
        $nameStmt_= $db->prepare("SELECT *_FROM qad_author WHERE author_id =_:author_id;");
__      while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
_ _  _      echo '<div class="quote">';
 _      _   $nameStmt->execute(array(":author_id" => $row["author"]));
     _      $rowName =_$nameStmt->fetch(PDO::FETCH_ASSOC);
      _   __echo "<q>", $row["quote"], "</q><br