b.php
<?php
$root = 'C:\';
?>
a.php
<?
include 'b.php';
echo $root;
?>
on commandline:
C:\cmdUtilities>php a.php
PHP Warning: Directive 'register_globals' is no longer supported in PHP 6 and g
reater in Unknown on line 0
PHP Warning: Directive 'register_long_arrays' is no longer supported in PHP 6 a
nd greater in Unknown on line 0
PHP Warning: Directive 'magic_quotes_gpc' is no longer supported in PHP 6 and g
reater in Unknown on line 0
Parse error: syntax error, unexpected $end in C:\cmdUtilities\b.php on line 2
Why I'm getting this error?
Problem on include
Moderator: General Moderators
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: Problem on include
are a.php and b.php in the same folder?
I would use include('b.php'); rather than include 'b.php';
I would use include('b.php'); rather than include 'b.php';
Re: Problem on include
thanks for replying!
I'm really hoping helps for this.(worrying if no one answered)
Yes,they are in the same folder.
As you see, then error shown "in b.php"
and I'm running a.php (ie,php checks b.php through a.php)
I'd tried "include" with brackets, without brackets, " and ' .
but it still reporting the error.
Why?
I'm really hoping helps for this.(worrying if no one answered)
Yes,they are in the same folder.
As you see, then error shown "in b.php"
and I'm running a.php (ie,php checks b.php through a.php)
I'd tried "include" with brackets, without brackets, " and ' .
but it still reporting the error.
Why?
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: Problem on include
Paste all the code here
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Problem on include
Code: Select all
$root = 'C:\\';mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Problem on include
Oh, thanks!This works!AbraCadaver wrote:Code: Select all
$root = 'C:\\';
But I feel dumb for such "changes"...
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Problem on include
That line was generating a parse error, because the \ was escaping the ' and so there was no closing 'tgckpg wrote:Oh, thanks!This works!AbraCadaver wrote:Code: Select all
$root = 'C:\\';
But I feel dumb for such "changes"...
Use this when developing:
Code: Select all
error_reporting(E_ALL);
ini_set('display_errors', '1');mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.