我正在尝试从数据库中获取值,好像我正在正确地获取它,但是在执行时它不起作用。它显示空白页,请指导,因为我是PHP MySql的新手
<html>
<body onload="motionjpeg('motionjpeg');">
<h1>ipCam</h1>
<img id="motionjpeg" src="http://127.0.0.1:8000/videoCV" />
</body>
</html>
<script>
function motionjpeg(id) {
var image = document.getElementById(id), src;
if (!image.length) return;
src = image.src
if (src.indexOf("?") < 0) {
image.src = src + "?"; // must have querystring
}
image.on("load", function() {
this.src = this.src.replace(/\?[^\n]*$/, "?") +
(new Date()).getTime(); // 'this' refers to the image
});
}
</script>
答案 0 :(得分:0)
请查看您服务器的php.ini
配置,以检查错误报告是否设置为某些内容。某些服务器隐藏了严重错误,以避免向黑客提供有关服务器缺陷的提示。
; error_reporting
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
error_reporting = E_ALL
更多信息:
; Error Level Constants:
; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
; E_ERROR - fatal run-time errors
; E_RECOVERABLE_ERROR - almost fatal run-time errors
; E_WARNING - run-time warnings (non-fatal errors)
; E_PARSE - compile-time parse errors
; E_NOTICE - run-time notices (these are warnings which often result
; from a bug in your code, but it's possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it's automatically initialized to an
; empty string)
; E_STRICT - run-time notices, enable to have PHP suggest changes
; to your code which will ensure the best interoperability
; and forward compatibility of your code
; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
; initial startup
; E_COMPILE_ERROR - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR - user-generated error message
; E_USER_WARNING - user-generated warning message
; E_USER_NOTICE - user-generated notice message
; E_DEPRECATED - warn about code that will not work in future versions
; of PHP
; E_USER_DEPRECATED - user-generated deprecation warnings
正如@Strawberry在评论中所说,调用不推荐使用的mysql*
函数时,您可能会遇到致命错误。改用mysqli*
(并激活PHP的mysqli扩展名)