Included file error on XAMPP 1.7.3

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Included file error on XAMPP 1.7.3

Postby eagle21 » 23. February 2010 10:44

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
eagle21
 
Posts: 3
Joined: 23. February 2010 10:33

Re: Included file error on XAMPP 1.7.3

Postby Altrea » 23. February 2010 11:15

- 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)?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Included file error on XAMPP 1.7.3

Postby eagle21 » 23. February 2010 16:08

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">
...........
eagle21
 
Posts: 3
Joined: 23. February 2010 10:33

Re: Included file error on XAMPP 1.7.3

Postby Altrea » 23. February 2010 17:10

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?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8293
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Included file error on XAMPP 1.7.3

Postby eagle21 » 24. February 2010 16:54

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.
^^
eagle21
 
Posts: 3
Joined: 23. February 2010 10:33

Re: Included file error on XAMPP 1.7.3

Postby MC10 » 24. February 2010 20:08

You can turn on short tags in xampp\php\php.ini and turning PHP short tags on, but it is not recommended.
MC10
 
Posts: 148
Joined: 20. February 2010 20:13

Re: Included file error on XAMPP 1.7.3

Postby heeriam » 02. March 2010 10:43

tattsächlich, das hat sehr gut funltioniert. Na schon wieder was dazugelernt. danke.
heeriam
 
Posts: 2
Joined: 02. March 2010 10:27


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 70 guests