Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2007
    Location
    tokyo
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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 Code:
    <a href="proshops01test.php?mode=kensaku&shopname=ロズビン&rowsperpage=5&pageidx=1" >test</a
    proshops01test.php
    PHP Code:
    <?php
    header
    ('Content-Type: text/html; charset=shift_jis');
    require_once(
    '../phpbase.php');
    include(
    WORKINGCLASSES .'clssearchindex.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.name,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($rowsperpage$pageidx);

    if ( 
    count($rows) > ) {
        
    // 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($limit 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($getDataPage) == ) {
                
    $getDataPage = array(=> $rows[$start]);
            }else {
                
    array_push($getDataPage,$rows[$start]);
            }

            
    $rowcount $rowcount 1;
        }

        return 
    $getDataPage;
    }
    ?>

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    An empty result after loading a PHP file generally is caused by errors in the page (missing includes/classes, syntax errors, etc.), while having error_reporting turned off (this is usually the case in production environments).

    Turn on error_reporting (turn off once done with debugging), or check your Apache/IIS logs.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •