<?php
$contentpage = "http://www.example.com/about/page.php";
require("http://www.example.com/passprotect.php");
if (function_exists('showpage'))
{
echo "2: function declared";
}
else
{
echo "2: function not declared";
}
showpage();
?>
And 'www.example.com/passprotect.php' contains<?php
function showpage()
{
/*
A long is function for password protected webpages
...
*/
if ($passValid)
{
require($contentpage);
}
}
if (function_exists('showpage'))
{
echo "1: function declared";
}
else
{
echo "1: function not declared";
}
?>
The function is declared when the second PHP page is require()'d but then it creates an error when I try and call it again.Is there anything I can do about this?
---------- Post added at 01:46 PM ---------- Previous post was at 01:44 PM ----------
I am relatively new to PHP so please excuse any stupid mistakes


Sign In
Create Account


Back to top









