HTML section:
<pre name= "code" class= "HTML" ><! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "></body>
jquery section:
<script type= "Text/javascript" >$ (document). Ready (function () {//Linkage drop-down menu $ ("#college"). Load ("/dyjsdp/college") ; $ ("#college"). Change (function () {$ (' #major '). Load ("/dyjsdp/major", "college=" +$ (This). Val ()); $ ("#major"). Change (function () { $ (' #classes '). Load ("/dyjsdp/class", "major=" +$ (This). Val ());}); </script>
Zend Framework Section: College linkage Public Function collegeaction () {//header ("content-type:text/html;charset=utf-8"); Header ("Cache-control:no-cache"); $colleges =new College (); $res = $colleges->fetchall (); echo "<option>--Please choose College--</option>"; foreach ($res as $college) {echo "<option>". $college [' name ']. " </option> "; } exit (); }//Professional linkage public Function majoraction () {//header ("content-type:text/xml;charset=utf-8"); Header ("Cache-control:no-cache"); $college = $this->getrequest ()->getparam ("College"); File_put_contents ("G:/php/myenv/mylog.log", $college); $majors =new Major (); $db = $majors->getadapter (); $sql = $db->quoteinto ("Select M.name from college c,major m where c.id=m.college_id and c.name=?", $college); $res = $db->query ($sql)->fetchall (); echo "<option>---Please select professional---</option>"; foreach ($res as $major) { echo "<option>". $major [' name ']. " </option> "; } exit (); }