[SOLVED] Undefined Function
Posted: Sun Aug 01, 2004 7:05 pm
Hello, I'm making a content managment system such as PHP nuke, and it's coming along good except I've run into a problem:
Fatal error: Call to undefined function: check_level() in ...\jakesys\postnews.php on line 10
Here is the structure of pages:
index.php includes header.php
...header.php declares function check_level
index.php includes postnews.php
...postnews.php calls function check_level
Here is the function declared right under the session_start of header.php:
And here is how I call it:
Is there some kind of extern command in PHP like in C++?
____________________________________
Also, I mind as well say this in this post instead of taking up 2 posts:
I love this site. I just found it today and I love how you guys totally tricked out phpBB like a car or something..!
____________________________________
If you can help me, thanks in advance!
Fatal error: Call to undefined function: check_level() in ...\jakesys\postnews.php on line 10
Here is the structure of pages:
index.php includes header.php
...header.php declares function check_level
index.php includes postnews.php
...postnews.php calls function check_level
Here is the function declared right under the session_start of header.php:
Code: Select all
function check_level($req_lvl){
if($_SESSION['level']>=$req_lvl){
return true;
}else{
echo "You lack permission to use access this page.<br />";
echo "Your current level is <strong>".$_SESSION['level']."</strong> (".$_SESSION['level_name'].").<br \>";
echo "The required level level is <strong>".$req_lvl."</strong> (".level_name($req_lvl).").<br \>";
return false;
}
}Code: Select all
//some code up here
if(check_level($perm_post_news)){
//post the news____________________________________
Also, I mind as well say this in this post instead of taking up 2 posts:
I love this site. I just found it today and I love how you guys totally tricked out phpBB like a car or something..!
____________________________________
If you can help me, thanks in advance!