0

ページがまったくロードされません。ブラウザーは、ロードされていない方法でリダイレクトしていると言っています。タイトルが示すように、require_once() に含める php ファイルの 1 つに問題があると思います。お見せしましょう:

サムネイル.php:

<?php
if(!function_exists("makethumbnail"))
{
     //die("right before function definition");
     function makethumbnail($src,$new_name,$new_width,$new_height)
     {
          die("inside makethumbnail");
          $si = imagecreatefromjpeg($src);
          $w = imagesx($si);
          $h = imagesy($si);
          $vi = imagecreatetruecolor($new_width,$new_height);
          imagecopyresampled($vi,$si,0,0,0,0,$new_width,$new_height,$w,$h);
          imagejpeg($vi,$new_name);
     }
}
?>

checksession.php:

<?php
session_start();
$session_name = "forces";
$com=0;
if(!function_exists("logout"))
{
    function logout()
    {
            $_SESSION = array();
            session_destroy();
            header('Location:http://cs4.sunyocc.edu/~j.d.dancks/index.php');
    }
}
if(!isset($_SESSION['time']) || !isset($_SESSION['nick']))
{
    $com=2;
    logout();
}
else if($_SESSION['time'] < time())
{
    $com=3;
    logout();
}
//redirect back to main whatever ignore this line
?>

index.php:

<?php
require_once("shopsite/thumbnail.php");
require_once("shopsite/checksession.php");
die("made it past the require_once");
$con = mysql_connect('localhost','jddancks','csc255');
mysql_select_db('test',$con);
$q = mysql_query("select prod_name,image_name,type1,type2 from Product",$con) or die("its the mysql");
$row = mysql_fetch_assoc($q);
$totalRows_Recordset1 = mysql_num_rows($q);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Welcome to the shopsite</title>
<script type="text/javascript" src="shopsite/lib/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="shopsite/lib/jquery.jcarousel.min.js"></script>
<link rel="stylesheet" type="text/css" href="shopsite/skins/ie7/skin.css" />
<script type="text/javascript">
     JQuery(document).ready(function() {
         JQuery('#mycarousel').jcarousel({
             itemLoadCallback:itemLoadCallbackFunction,
             start:1,
             auto:3,
             animation:"slow",
             wrap:"both"
         });
     });
</script>
</head>
<body>
<?php
session_start();
if(isset($_SESSION['nick']))
{
     echo "<p>Welcome, ".$_SESSION['nick']."</p>";
}
die("Made it past the first php");
?>
<h1>Welcome to the one-stop shop for your every need!</h1>
<div class="jcarousel-ie7">
<p>Browse Items:</p>
<div class="jcarousel-container">
<div class="jcarousel-clip">
<ul id="mycarousel" class="jcarousel-skin-ie7">
<?php
$cnt=1;
do
{
     $i=$row['image_name'];
     $name=preg_split("/.jpg/",$i);
     $name = "shopsite/thumb/".$name[0]."-index.jpg";
     if(!file_exists($name))
     {
          makethumbnail("shopsite/images/".$row['image_name'],$name,50,50);
     }
     echo " <li class=\"jcarousel-item-".$cnt."\"><img src=\"".$name."\" /></li>\n";
     $cnt=$cnt+1;
     if($cnt>12) die("cnt larger than 12");
}
while($row = mysql_fetch_assoc($q));
?>
</ul>
</div>
<div disabled="disabled" class="jcarousel-prev jcarousel-prev-disabled"></div>
<div class="jcarousel-next"></div>
</div>
</div>
</body>
</html>
<?php mysql_free_result($row);
mysql_close($con); ?>

jquery カルーセルに画像を挿入して、訪問者が購入したいアイテムを閲覧できるようにしたいと考えています。私は jcarousel を使用したことがないので、私が持っているものが機能するかどうかはわかりませんが、それは問題ではないと確信しています。私はそれがあなたが2番目の目を必要とするものの1つに過ぎないと思います. サムネール .php の die ステートメントを見ると、それが原因だと思われますが、関数の最初の行まで到達しないため、非常に混乱します。クライアント側を除いて、phpプリプロセッサがどのように機能するかわかりません。

4

0 に答える 0