简体   繁体   中英

php file only blank page without errors

i have got this php file, which shows me only a blank page. i think i have an syntax error, but i doesn't get any errors. I set these 2 lines to show me errors, but i get nothing.

error_reporting(E_ALL); ini_set('display_errors', 1);

<?php
header('Content-Type: text/html; charset=utf-8');

error_reporting(E_ALL);
ini_set('display_errors', 1);


$var1= $_GET['var1'];   
$var2= $_GET['var2'];
$var3 = $_GET['var3'];

if ( (!empty($var1)) ||  (!empty($var2))  ||  (!empty($var3)) )

       echo "NOT EMPTY";

    } else {

        echo "EMPTY";

    }
?>

You have a PARSE error. (like luweiqi told you) If your script cannot be parsed, an error will be written away to the errorlog. It will NOT appear in the output. PHP considers that script as non-valid.

In cases like this, check your errorlog (in apache or wherever you store it)

You missed out an opening curly bracket:

if ( (!empty($var1)) ||  (!empty($var2))  ||  (!empty($var3)) ) {

Your file already has a syntax error, thus to show the error, you'll need to set this in php.ini :

display_errors = on;

打开您的php.ini并检查此行display_errors如果off更改为on

display_errors = on;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM