Originariamente inviato da regolo76
l'errore non è nella variabile in se ma nel percorso che deve essere assoluto di tipo
$percorso = '/var/www/miosito/include/conn.php';
e non
http://
L'avevo pensato anche io, ma poi vedi l'esempio sul manuale:
Codice PHP:
<?php
/* This example assumes that [url]www.example.com[/url] is configured to parse .php
* files and not .txt files. Also, 'Works' here means that the variables
* $foo and $bar are available within the included file. */
// Won't work; file.txt wasn't handled by [url]www.example.com[/url] as PHP
include 'http://www.example.com/file.txt?foo=1&bar=2';
// Won't work; looks for a file named 'file.php?foo=1&bar=2' on the
// local filesystem.
include 'file.php?foo=1&bar=2';
// Works.
include 'http://www.example.com/file.php?foo=1&bar=2';
$foo = 1;
$bar = 2;
include 'file.txt'; // Works.
include 'file.php'; // Works.