...

View Full Version : During production the generated HTML by the PHP was not displayed.



erosszz
08-28-2007, 10:05 AM
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

<a href="proshops01test.php?mode=kensaku&shopname=ロズビン&rowsperpage=5&pageidx=1" >test</a>

proshops01test.php

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

$rowcount = $rowcount + 1;
}

return $getDataPage;
}
?>

aedrin
08-29-2007, 12:34 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum