Page 1 of 1

Included file error on XAMPP 1.7.3

PostPosted: 23. February 2010 10:44
by eagle21
I've installed XAMPP 1.7.3 on my PC. Certainly there are no problem at the installation process. But when I open my php project. It's not running correctly. It display all variable and function from the included php files (as showing images).

Image

Please advise me.
Thanks

Re: Included file error on XAMPP 1.7.3

PostPosted: 23. February 2010 11:15
by Altrea
- Which file-extension do your php files use?
- how do you open/access your php files?
- do you use short open tags (<? instead of <?php or <?= instead of <?php echo)?

Re: Included file error on XAMPP 1.7.3

PostPosted: 23. February 2010 16:08
by eagle21
This is my index.php file.

Code: Select all
<?php
    @session_start();
    if ( !file_exists('sys/conf/ep_config.php'))
        header( 'Location: install/index.php' );
    else{
        $x = dirname(__FILE__)."/sys/conf/ep_config.php";
        $y = dirname(__FILE__)."/include/php/function.php";

        include($x);           // It'll print all variable and function on this line
        include($y);           // and this line.
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>xxxxxxxxx</title>
    <link href="include/css/epidem.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="include/js/validator.js"></script>   <!-- Javascript for Form Validator -->
    <script type="text/javascript" src="include/js/ajax_dropdown.js"></script> <!-- Javascript for AJAX Triple Dropdown -->
</head>
<body>
<div id="allframe">
...........

Re: Included file error on XAMPP 1.7.3

PostPosted: 23. February 2010 17:10
by Altrea
Your code is working in my xampp.

does error_reporting(E_ALL) throw some errors/notices/hints?
does any of your files have an utf-8 byte-order-marks?
does your included code wrongly close your else { brackets?
where is your else { closing bracket?

Re: Included file error on XAMPP 1.7.3

PostPosted: 24. February 2010 16:54
by eagle21
I've got it. That's my fault.
The problem was occur because I'm using short open tags (<? instead of <?php ) in my included file.

Thanks to Altrea.
^^

Re: Included file error on XAMPP 1.7.3

PostPosted: 24. February 2010 20:08
by MC10
You can turn on short tags in xampp\php\php.ini and turning PHP short tags on, but it is not recommended.

Re: Included file error on XAMPP 1.7.3

PostPosted: 02. March 2010 10:43
by heeriam
tattsächlich, das hat sehr gut funltioniert. Na schon wieder was dazugelernt. danke.