During production the generated HTML by the PHP was not displayed.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eros
    New Member
    • Jun 2007
    • 66

    During production the generated HTML by the PHP was not displayed.

    During development (debugging) the site works well but when I release from the debugging and test into production.. the result from PHP file was not displayed.

    test.php
    [PHP]<a href="proshops0 1test.php?mode= kensaku&shopnam e=ロズビン&rowsperp age=5&pageidx=1 " >test</a>[/PHP]


    proshops01test. php
    [PHP]<?php
    header('Content-Type: text/html; charset=shift_j is');
    require_once('. ./phpbase.php');
    include(WORKING CLASSES .'clssearchinde x.php');
    session_start() ;

    $mode = $_GET['mode'];
    $shopname = iconv("UTF-8", "SJIS", $_GET['shopname']);
    $kensakukekka = "";
    $rowsperpage = $_GET['rowsperpage'];
    $pageidx = $_GET['pageidx'];

    $sql = "";
    $sql = "SELECT
    distinct sh.shopcd,sh.na me,sh.postcode, sh.areanum, sh.othernum
    ,pc.ken, pc.shi, pc.ku, pc.machi
    FROM
    shopcontacts sc LEFT JOIN shops sh
    ON sc.shopcd = sh.shopcd
    LEFT JOIN postcodes as pc
    ON sh.postcode = pc.postcode
    WHERE sh.name like '%". $shopname ."%'";
    // created dbconnection
    $c_rs = new Recordset();
    // fetch all data based on the criteria
    $_SESSION['$o_search'] = $c_rs->query($sql);
    // get the data tobe displayed based on the rowsperpage
    $rows = getDataPage($ro wsperpage, $pageidx);

    if ( count($rows) > 0 ) {
    // create the list with <a> tag for hyperlink
    foreach ($rows as $row){
    $kensakukekka = $kensakukekka ."<a id='hyouji' name='hyouji'\n ";
    $kensakukekka = $kensakukekka ."href=\"\" />\n";
    $kensakukekka = $kensakukekka . $row['name'] . "</a><br/>\n";
    $kensakukekka = $kensakukekka ."<small>〒". $row['postcode'] ."</small><br/><br/>\n";
    }

    $_SESSION['kensakukekka'] = $kensakukekka;
    // generate the HTML code
    print $_SESSION['kensakukekka'];
    }else {
    $eof = false;
    }

    function getDataPage($li mit = 5, &$idx = 1) {
    $getDataPage = new ArrayObject();
    $rows = $_SESSION['$o_search'];

    if ( $limit > count($rows) ) {
    $limit = count($rows);
    $idx = 1;
    }

    $rowcount = 0;
    for ($start = 0; $rowcount < $limit; $start++) {
    if ( ! isset($rows[$start]) ) {
    break;
    }

    if ( count($getDataP age) == 0 ) {
    $getDataPage = array(0 => $rows[$start]);
    }else {
    array_push($get DataPage,$rows[$start]);
    }

    $rowcount = $rowcount + 1;
    }

    return $getDataPage;
    }
    ?>[/PHP]
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    ...
    the result from PHP file was not displayed.
    Is it giving any error?
    and what is this in your URL String
    shopname=ロズビン

    Comment

    • eros
      New Member
      • Jun 2007
      • 66

      #3
      Originally posted by ajaxrand
      Is it giving any error?
      and what is this in your URL String
      shopname=ロズビン
      There's no any error message.
      Note: I configured the php.ini to displayed all errors.

      shopname=ロズビン
      -> shopname is the fieldname.
      -> ロズビン is the value.

      kensaku
      -> it means search in english.

      My site is Japanese using shift_jis as the charset.

      It quite strange because when I debug the site using my IDE (tool), It works well and perfect.

      Comment

      • eros
        New Member
        • Jun 2007
        • 66

        #4
        I am using __autoload function in order to automatically load the includes needed.

        What do you think?

        Comment

        • pbmods
          Recognized Expert Expert
          • Apr 2007
          • 5821

          #5
          Heya, Eros.

          If you add this to the bottom of your code:
          [code=php]
          echo 'Well at least this works....';
          [/code]

          Do you get any output?

          Comment

          Working...