Salve (e buon 2008 a tutti)
dunque mi ritrovo nella situazione di dover includere un file .php nel mio progetto poiche il file contiene delle variabile da recuperare ho provato ad includere il file ma il file stesso contiene una funzione al suo interno con conseguente autochiamata, la domanda e' come faccio ad includere il file senza far eseguire la funzione ? oppure esiste 1 altro modo per prendermi le variabili che mi servono da quel file ?
ringrazio anticipatamente
posto i 2 file :
file copy.php
codice:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2006 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
// To have the Copyright window work in your module just fill the following
// required information and then copy the file "copyright.php" into your
// module's directory. It's all, as easy as it sounds ;)
$author_name = "Francisco Burzi";
$author_email = "";
$author_homepage = "http://phpnuke.org";
$license = "GNU/GPL";
$download_location = "http://phpnuke.org/modules.php?name=Downloads";
$module_version = "1.0";
$module_description = "Module to have simple content for your web site. You can also categorize the content.";
// DO NOT TOUCH THE FOLLOWING COPYRIGHT CODE. YOU'RE JUST ALLOWED TO CHANGE YOUR "OWN"
// MODULE'S DATA (SEE ABOVE) SO THE SYSTEM CAN BE ABLE TO SHOW THE COPYRIGHT NOTICE
// FOR YOUR MODULE/ADDON. PLAY FAIR WITH THE PEOPLE THAT WORKED CODING WHAT YOU USE!!
// YOU ARE NOT ALLOWED TO MODIFY ANYTHING ELSE THAN THE ABOVE REQUIRED INFORMATION.
// AND YOU ARE NOT ALLOWED TO DELETE THIS FILE NOR TO CHANGE ANYTHING FROM THIS FILE IF
// YOU'RE NOT THIS MODULE'S AUTHOR.
function show_copyright() {
global $author_name, $author_email, $author_homepage, $license, $download_location, $module_version, $module_description;
if ($author_name == "") { $author_name = "N/A"; }
if ($author_email == "") { $author_email = "N/A"; }
if ($author_homepage == "") { $author_homepage = "N/A"; }
if ($license == "") { $license = "N/A"; }
if ($download_location == "") { $download_location = "N/A"; }
if ($module_version == "") { $module_version = "N/A"; }
if ($module_description == "") { $module_description = "N/A"; }
$module_name = basename(dirname(__FILE__));
$module_name = eregi_replace("_", " ", $module_name);
echo "<html>\n"
."<body bgcolor=\"#F6F6EB\" link=\"#363636\" alink=\"#363636\" vlink=\"#363636\">\n"
."<title>$module_name: Copyright Information</title>\n"
."<font size=\"2\" color=\"#363636\" face=\"Verdana, Helvetica\">\n"
."<center>Module Copyright © Information
"
."$module_name module for <a href=\"http://phpnuke.org\" target=\"new\">PHP-Nuke</a>
</center>\n"
."<img src=\"../../images/arrow.gif\" border=\"0\">Module's Name: $module_name
\n"
."<img src=\"../../images/arrow.gif\" border=\"0\">Module's Version: $module_version
\n"
."<img src=\"../../images/arrow.gif\" border=\"0\">Module's Description: $module_description
\n"
."<img src=\"../../images/arrow.gif\" border=\"0\">License: $license
\n"
."<img src=\"../../images/arrow.gif\" border=\"0\">Author's Name: $author_name
\n"
."<img src=\"../../images/arrow.gif\" border=\"0\">Author's Email: $author_email
\n"
."<center>[ <a href=\"$author_homepage\" target=\"new\">Author's HomePage</a> | <a href=\"$download_location\" target=\"new\">Module's Download</a> | <a href=\"javascript:void(0)\" onClick=javascript:self.close()>Close</a> ]</center>\n"
."</font>\n"
."</body>\n"
."</html>";
}
show_copyright();
?>
miofile.php
codice:
<?php
include_once("copyright.php");
echo "Il nome del progetto e' : ".$module_name;
echo "la descrizione del progetto e' : ".$module_description;
?>