#35383 [Opn->Fbk]: can't open the page autoshow.php

From: Date: Fri, 25 Nov 2005 10:11:31 +0000
Subject: #35383 [Opn->Fbk]: can't open the page autoshow.php
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88913@lists.php.net to get a copy of this message
 ID:               35383
 Updated by:       tony2001@php.net
 Reported By:      kismet at 56 dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Apache2 related
 Operating System: windows xp sp2
 PHP Version:      6CVS-2005-11-25 (snap)
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.




Previous Comments:
------------------------------------------------------------------------

[2005-11-25 08:40:42] kismet at 56 dot com

Description:
------------
apache.exe application error
 "0x0076cc6a" instruction referenced memory "0x45532730"
 can not be readed.


Reproduce code:
---------------
<?
ob_start();
$dsn = 'sqlite:view.db';
try {
    $dbh = new PDO($dsn, $user, $password);
    $dbh->beginTransaction();
    $sqlno = 'SELECT max(serial) FROM picture';
    $sthno = $dbh->prepare($sqlno);
    $sthno->execute();
    $res = $sthno->fetch();
    $maxnum = $res[0];
} catch (PDOException $e) {
   echo 'Connection failed: ' . $e->getMessage();
}

if (!$num)
{
$num = 1;
try {
    $dbh = new PDO($dsn, $user, $password);
    $dbh->beginTransaction();
    $sql = 'SELECT length,code FROM picture where serial ='.$num;
    $sth = $dbh->prepare($sql);
    $sth->execute();
    $result = $sth->fetch();
    $dsn=null;
} catch (PDOException $e) {
   echo 'Connection failed: ' . $e->getMessage();
   $dsn=null;
}
header("Content-type: image/jpeg");
header("Refresh:2;URL=autoshow.php");
echo base64_decode($result[1]);
setcookie("num",$num+1);
}
elseif($num <= $maxnum)
{
	$num=$_COOKIE["num"];
try {
    $dbh = new PDO($dsn, $user, $password);
    $dbh->beginTransaction();
    $sql = 'SELECT length,code FROM picture where serial ='.$num;
    $sth = $dbh->prepare($sql);
    $sth->execute();
    $result = $sth->fetch();
    $dsn=null;
} catch (PDOException $e) {
   echo 'Connection failed: ' . $e->getMessage();
   $dsn=null;
}
header("Content-type: image/jpeg");
header("Refresh:2;URL=autoshow.php");
echo base64_decode($result[1]);
setcookie("num",$num+1);
}
else
{
 print "<script language=\"javascript\">";
 print "alert (\"È«²¿Í¼Æ¬ÏÔʾÍê³É\");";
 print "window.close();";
 print "</script>"; 
}
?>

Expected result:
----------------
the page refreshed every 2 second to show anther picture

Actual result:
--------------
just show the first picture then it core down.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35383&edit=1


Thread (2 messages)

« previous php.bugs (#88913) next »