No response from remote server after migrating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • grace01
    New Member
    • Sep 2007
    • 6

    No response from remote server after migrating

    My php program has no response after migration. Here is the php code:

    [Code=php]

    <?php

    include_once("c lasses/ets.php");
    include_once("c lasses/em_documents.ph p");
    include_once("c lasses/em_sections.php ");
    include_once("c lasses/em_attachment.p hp");
    include_once("c lasses/site_tools.php" );

    $mainblocks = array();

    $obj_em_section s = new em_sections();
    $obj_em_section s->set_debug(true );


    if ($_GET["cid"]!="") {
    $arr_course_gro up = $obj_em_section s->fetch('id='.$_ GET["cid"]);
    } else {
    $arr_course_gro up = $obj_em_section s->fetch_byparent (3,"ordernum") ;
    }

    foreach ($arr_course_gr oup as $group) {

    $arr_tree = $obj_em_section s->fetch_tree($gr oup->id);
    if (count($arr_tre e)>0) {
    $tmpgrp->title = $group->descript;
    $tmpgrp->id = $group->id;
    $folder_tree = array();

    $arr_tree2 = $arr_tree;
    $arr_withchildr en = array();

    foreach ($arr_tree as $tree) {
    $tmpitem->level = $tree[1];
    $tmpitem->id = $tree[0]->id;

    for ($i=0;$i<$tree[1];$i++) {
    $prefix .= "&nbsp;&nbsp;&n bsp;&nbsp;";
    }

    //determine if this is id has children
    foreach ($arr_tree2 as $tree2) {
    if ($tree2[0]->parent_id==$tm pitem->id) {
    array_push($arr _withchildren,$ tmpitem->id);
    }
    }
    $arr_withchildr en = array_unique($a rr_withchildren );

    if (in_array($tmpi tem->id,$arr_withch ildren)) {
    //no link required
    $tmpitem->title = $tree[0]->descript;
    $tmpitem->fullpage->title = "";
    $tmpitem->fullpage->url = "";
    } else {
    $tmpitem->title = "";
    $tmpitem->fullpage->title = $tree[0]->descript;
    $tmpitem->fullpage->url = "?cid=".$tr ee[0]->id;
    }
    $tmpitem->tabs = $prefix;

    array_push($fol der_tree,$tmpit em);
    $prefix="";
    }
    $tmpgrp->folders = $folder_tree;
    array_push($mai nblocks,$tmpgrp );
    $tmpgrp="";
    } else {
    if ($_GET["cid"]!="") {
    $arr_subsects = array($_GET['cid']);
    $courses = array();

    $obj_em_section s = new em_sections();
    $return_array = $obj_em_section s->fetch("id=".$_ GET['cid']);
    if (count($return_ array)>0) {
    foreach ($return_array as $section) {
    $tmpgrp->title = $section->descript;
    $tmpgrp->id = $section->id;
    }
    }
    $obj_em_documen ts = new em_documents();
    $obj_em_documen ts->set_debug(fals e);
    $arr_courses = "";
    $orderby = "title";
    $arr_courses = $obj_em_documen ts->fetch_bysectio ntree("intrash= 0 AND isonline='TRUE' ",$arr_subsects ,$orderby);
    if (count($arr_cou rses)>0) {
    foreach ($arr_courses as $course) {

    if (site_tools::is _published($cou rse->publish_on) && !site_tools::is _expired($cours e->remove_on)) {

    if ($course->redirecturl!=" ") {
    //display the alternate URL
    $arr_urlbits = explode(",",$co urse->redirecturl) ;
    if (count($arr_url bits)>0) {
    list($width,$he ight) = explode("x",$ar r_urlbits[1]);
    $tmpcourse->alturlpopup->title = $course->title;
    $tmpcourse->alturlpopup->w = $width;
    $tmpcourse->alturlpopup->h = $height;
    $tmpcourse->alturlpopup->url = $arr_urlbits[0];
    } else {
    // no parameters given, open full window
    $tmpcourse->fullpage->title = $course->title;
    $tmpcourse->fullpage->url = $arr_urlbits[0];
    $tmpcourse->fullpage->target = "_blank";
    }

    } else {
    //display the default URL
    $tmpcourse->defaultpopup->title = $course->title;
    $tmpcourse->defaultpopup->id = $course->id;
    }
    array_push($cou rses,$tmpcourse );
    $tmpcourse="";
    }
    }
    } else {
    $courses[0]->descript = "No courses available at this time.";
    }
    $tmpgrp->folders = $courses;
    array_push($mai nblocks, $tmpgrp);
    $tmpgrp="";
    }
    }
    }



    $page->mainblocks = $mainblocks;
    printt($page,'t emplates/php_ourbiz.tpl' );
    ?>
    [/Code]


    The result of array mainblock is
    Code:
    Array ( [0] => stdClass Object ( [title] => Skills Development [id] => 17 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 32 [title] => [fullpage] => stdClass Object ( [title] => Information Technology (IT) Literacy Skills [url] => ?cid=32 ) [tabs] =>      ) [1] => stdClass Object ( [level] => 1 [id] => 33 [title] => Language & Communication Skills [fullpage] => stdClass Object ( [title] => [url] => ) [tabs] =>      ) [2] => stdClass Object ( [level] => 2 [id] => 40 [title] => [fullpage] => stdClass Object ( [title] => Communication Skills [url] => ?cid=40 ) [tabs] =>          ) [3] => stdClass Object ( [level] => 2 [id] => 42 [title] => [fullpage] => stdClass Object ( [title] => Language Skills [url] => ?cid=42 ) [tabs] =>          ) [4] => stdClass Object ( [level] => 2 [id] => 41 [title] => [fullpage] => stdClass Object ( [title] => Presentation Skills [url] => ?cid=41 ) [tabs] =>          ) [5] => stdClass Object ( [level] => 1 [id] => 20 [title] => Skills in Hospitality [fullpage] => stdClass Object ( [title] => [url] => ) [tabs] =>      ) [6] => stdClass Object ( [level] => 2 [id] => 49 [title] => [fullpage] => stdClass Object ( [title] => Culinary Skills [url] => ?cid=49 ) [tabs] =>          ) [7] => stdClass Object ( [level] => 2 [id] => 34 [title] => [fullpage] => stdClass Object ( [title] => Customer Service [url] => ?cid=34 ) [tabs] =>          ) [8] => stdClass Object ( [level] => 2 [id] => 57 [title] => [fullpage] => stdClass Object ( [title] => Food & Beverage Operations [url] => ?cid=57 ) [tabs] =>          ) [9] => stdClass Object ( [level] => 2 [id] => 21 [title] => National Skills Recognition System (NSRS) [fullpage] => stdClass Object ( [title] => [url] => ) [tabs] =>          ) [10] => stdClass Object ( [level] => 3 [id] => 22 [title] => [fullpage] => stdClass Object ( [title] => Food & Beverage Services [url] => ?cid=22 ) [tabs] =>              ) [11] => stdClass Object ( [level] => 3 [id] => 35 [title] => [fullpage] => stdClass Object ( [title] => Food Preparation & Production [url] => ?cid=35 ) [tabs] =>              ) [12] => stdClass Object ( [level] => 3 [id] => 36 [title] => [fullpage] => stdClass Object ( [title] => Hotel Supervisory And Management [url] => ?cid=36 ) [tabs] =>              ) [13] => stdClass Object ( [level] => 3 [id] => 37 [title] => [fullpage] => stdClass Object ( [title] => Rooms [url] => ?cid=37 ) [tabs] =>              ) [14] => stdClass Object ( [level] => 2 [id] => 39 [title] => [fullpage] => stdClass Object ( [title] => Technical Service [url] => ?cid=39 ) [tabs] =>          ) [15] => stdClass Object ( [level] => 2 [id] => 45 [title] => [fullpage] => stdClass Object ( [title] => Train-The-Trainer [url] => ?cid=45 ) [tabs] =>          ) [16] => stdClass Object ( [level] => 1 [id] => 60 [title] => [fullpage] => stdClass Object ( [title] => Workforce Skills Qualifications (WSQ) [url] => ?cid=60 ) [tabs] =>      ) ) ) [1] => stdClass Object ( [title] => Academic Development [id] => 18 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 56 [title] => [fullpage] => stdClass Object ( [title] => Certificate Programmes [url] => ?cid=56 ) [tabs] =>      ) [1] => stdClass Object ( [level] => 1 [id] => 29 [title] => [fullpage] => stdClass Object ( [title] => Diploma Programmes [url] => ?cid=29 ) [tabs] =>      ) [2] => stdClass Object ( [level] => 1 [id] => 28 [title] => [fullpage] => stdClass Object ( [title] => NITEC Programmes [url] => ?cid=28 ) [tabs] =>      ) ) ) [2] => stdClass Object ( [title] => Executive Development [id] => 19 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 31 [title] => [fullpage] => stdClass Object ( [title] => Leadership [url] => ?cid=31 ) [tabs] =>      ) [1] => stdClass Object ( [level] => 1 [id] => 26 [title] => [fullpage] => stdClass Object ( [title] => Marketing & Sales [url] => ?cid=26 ) [tabs] =>      ) [2] => stdClass Object ( [level] => 1 [id] => 30 [title] => [fullpage] => stdClass Object ( [title] => Soft Skills [url] => ?cid=30 ) [tabs] =>      ) [3] => stdClass Object ( [level] => 1 [id] => 54 [title] => [fullpage] => stdClass Object ( [title] => Technical Knowledge [url] => ?cid=54 ) [tabs] =>      ) ) ) [3] => stdClass Object ( [title] => Professional Development [id] => 27 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 38 [title] => [fullpage] => stdClass Object ( [title] => Raffles Professional Development (RPD) Programmes [url] => ?cid=38 ) [tabs] =>      ) ) ) [4] => stdClass Object ( [title] => Children's Programme [id] => 46 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 48 [title] => [fullpage] => stdClass Object ( [title] => Children Courses [url] => ?cid=48 ) [tabs] =>      ) ) ) [5] => stdClass Object ( [title] => Innovative Programmes [id] => 52 [folders] => Array ( [0] => stdClass Object ( [level] => 1 [id] => 53 [title] => [fullpage] => stdClass Object ( [title] => Innovation [url] => ?cid=53 ) [tabs] =>      ) ) ) )
    My source code of the template file php_ourbiz.tpl is as follow:

    Code:
    {mask:main} 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
    <head> 
    <script language="JavaScript"> 
    {# 
    <!-- 
    function MM_preloadImages() { //v3.0 
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); 
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) 
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} 
    } 
    
    function MM_findObj(n, d) { //v4.0 
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { 
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} 
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; 
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); 
      if(!x && document.getElementById) x=document.getElementById(n); return x; 
    } 
    
    function MM_swapImage() { //v3.0 
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) 
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} 
    } 
    
    function MM_openBrWindow(theURL,winName,features) { //v2.0 
      window.open(theURL,winName,features); 
    } 
    //--> 
    #} 
    </script> 
    <title>Raffles International Training Centre</title> 
    <link rel="stylesheet" href="css/main.css" type="text/css"> 
    </head> 
    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" 
    img src="images/spacer.gif" width="5" height="8" onLoad="MM_swapImage('skilldev','','images/sidemenu_arrow.jpg','academicdev','','images/spacer.gif','exedev','','images/spacer.gif','profdev','','images/spacer.gif',1)"> 
    <script type="text/javascript" language="JavaScript1.2" src="js/sect_stm31.js"></script> 
    <script type="text/javascript" language="JavaScript1.2" src="js/sect_navi_menu.js"></script> 
    <TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0> 
      <TR> 
        <TD width="188"> 
            <div id="Layer1" style="position:absolute; width:397px; height:19px; z-index:1; left: 390px; top: -3px"><a class="sidemenu" href="http://www.rafflesinternational.com" target="_blank">Raffles International Limited</a>&nbsp;<font color="#FF6600" size="1" face="Verdana, Arial, Helvetica, sans-serif">|</font>&nbsp;<a class="sidemenu" href="http://www.rkpl.com" target="_blank">Raffles Knowledge Private Limited</a></div> 
          <IMG SRC="images/aboutus_01.jpg" WIDTH=188 HEIGHT=158 ALT="" align="absbottom"></TD>      
    
        <TD background="images/sect_titlebg.gif"> 
          <div align="left"><img src="images/title_aboutus.jpg" width="582" height="158" align="absbottom"> 
          </div> 
        </TD> 
      </TR> 
    </TABLE> 
    <table width="100%" cellspacing="0" cellpadding="0" border="0" height="500"> 
      <tr> 
        <td width="155" bgcolor="#ffffff" valign="top" > 
          <!--//START: LEFT_TOPNAV//--> 
          <table border="0" cellspacing="0" cellpadding="0" width="100%"> 
            <tr> 
              <td><img src="images/spacer.gif" width="188" height="1" border="0"></td> 
            </tr> 
          </table> 
    <!--//Start : Sidemenu//--> 
    <table border="0" cellspacing="0" cellpadding="0" width="100%"> 
            <tr> 
              <td><img src="images/spacer.gif" width="188" height="1" border="0"></td> 
            </tr> 
          </table> 
    <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center"> 
            <tr> 
              <td width="7%"><img src="images/spacer.gif" width="9" height="10" align="middle"></td> 
              <td width="93%">&nbsp;</td> 
            </tr> 
            <tr> 
              <td width="7%" height="16"><img src="images/spacer.gif" width="9" height="10" align="middle" name="skilldev"></td> 
              <td width="93%" height="2"><a class="sidemenu" href="our_biz.php#17">Skills Development</a></td> 
    </tr> 
    <td width="7%" height="16"><img src="images/spacer.gif" width="9" height="10" align="middle" name="academicdev"></td> 
    <td width="93%" height="2"><a class="sidemenu" href="our_biz.php#18">Academic Development</a></td> 
       </tr><td width="7%" height="16"><img src="images/spacer.gif" width="9" height="10" align="middle" name="exedev"></td> 
    <td width="93%" height="2"><a class="sidemenu" href="our_biz.php#19">Executive Development</a></td> 
    </tr><td width="7%" height="16"><img src="images/spacer.gif" width="9" height="10" align="middle" name="profdev"></td> 
              <td width="93%" height="2"><a class="sidemenu" href="our_biz.php#27">Professional Development</a></td> 
       </tr> 
       <tr> 
     </tr> 
          </table> 
        
        </td> 
        <td width="100%" bgcolor="#EDEDF0" valign="top"> 
    
          <a name="#top"> 
          <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center"> 
            <tr> 
              <td align="center"><img src="/images/spacer.gif" height="10" width="1"></td> 
            </tr>      
            <tr> 
              <td valign="top" height="656"> 
                <p><span class="font11_333333"><b class="font12_CC0003">Our Business </b> 
                  </span></p> 
                {mask:mainblocks} 
                <a name="#{id}"> 
                <table width="98%" border="0" cellpadding="2" align="center" cellspacing="0"> 
                  <tr> 
                    <td class="font11_003399" bgcolor="#2C2C83" height="25"><b class="font13_ffffff">&nbsp;&nbsp;{title} </b></td> 
                  </tr> 
                  <tr> 
                    <td bgcolor="#DCE3EF"> 
                    <ul> 
                      {mask:folders}{tabs}<img src="images/squarebullet.gif" vspace="2">&nbsp;&nbsp;<span class="font11_333333">{fullpage}{alturlpopup}{defaultpopup}{title}</span><br> 
                      {/mask} 
                    </ul> 
                    </td> 
                  </tr> 
                  <tr> 
                    <td bgcolor="EDEDF0" class="font11_333333" height="3"><img src="images/spacer.gif" width="1" height="3"></td> 
                  </tr> 
                </table> 
                <p> 
                {/mask} 
                        
              </td> 
            </tr> 
          </table> 
          <!--//END: CONTENT_BODY//--> 
          <!--//START: page_frame_2.tpl//--> 
        
    
    <tr> 
        
      <td colspan="2" bgcolor="#999999" height="1"><img src="images/spacer.gif" width="100%" height="1"></td> 
    </tr> 
    
    <!--//END: page_frame_2.tpl//--> 
      <!--//END: PAGE_CONTENT//--> 
      <p> 
    <!--//START: PAGE_FOOTER//--> 
    <table border="0" cellspacing="0" cellpadding="0" width="90%" align="center"> 
      <tr> 
        <td>&nbsp;</td> 
      </tr> 
    <tr><td align="center" class="footer">Copyright © 2004 Raffles International Training Centre, Singapore.  
      All Rights Reserved. <a class="footer" href="home_terms.shtml">Terms and 
      Conditions</a><br>Designed And Created By :<a class="footer" href="http://www.1-net.com.sg" target="_blank">1-Net Singapore</a></td></tr> 
    </table> 
    <!--//END: PAGE_FOOTER//--> 
    
    </table></body> 
    
    </html> 
    
    {/mask} 
    {mask:defaultpopup} 
    <a class="paralink" href=javascript:; onClick=window.open('our_biz_course.php?cid={id}','nb','width=520,height=400,scrollbars,')>{title}</a> 
    {/mask} 
    {mask:alturlpopup} 
    <a class="paralink" href=javascript:; onClick=window.open('{url}','nb','width={w},height={h},scrollbars')>{title}</a> 
    {/mask} 
    {mask:fullpage} 
    <a href="{url}" target="{target}" class="paralink">{title}</a> 
    {/mask} 
     
    It seems there are some problem of displaying the line in the template: 
    Code: 
    
    {mask:folders}{tabs}<img src="images/squarebullet.gif" vspace="2">&nbsp;&nbsp;<span class="font11_333333">{fullpage}{alturlpopup}{defaultpopup}{title}</span><br>
    How I modify to make it work properly?

    Thanks
    Grace
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Grace.

    Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

    What do you want your code to do? Give an example.
    What is your code doing that you don't want it to do? Give an example.
    What is your code *not* doing that it is supposed to? Give an example.

    Comment

    Working...