| | |
a Function that is not working...
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2009
Posts: 42
Reputation:
Solved Threads: 0
I am generating a PHP error with this function but don't know why.
Little help...
Little help...
PHP Syntax (Toggle Plain Text)
function Validate_Page_Nav($LastPage, $ErrorPage) { if($_SESSION['Staff_ID']) { $trimmed = str_replace($staffroot, '', $_SERVER['SCRIPT_NAME']); $resul = $db->query("SELECT * FROM Page_Access WHERE URI = '$trimmed'") or die("failed to get access data"); $page_access = $resul->fetch_assoc(); $URI_access = explode(",", $page_access['User_Level']); if(in_array($_SESSION['Staff_level'], $URI_access)) { if($_SESSION['Last_Page'] != $LastPage) { header("location: {$ErrorPage}?message=Unable to update user information."); exit(); } } $_SESSION['Last_Page'] = $trimmed; } } Validate_Page_Nav("user_list.php","user_list.php");
•
•
Join Date: Jul 2009
Posts: 42
Reputation:
Solved Threads: 0
0
#3 31 Days Ago
•
•
•
•
Has your session started correctly before the call to your function? Check by echo'ing $_SESSION["Last_Page"] and make sure it's what you expect.
What error message do you generate?
I am not certain how to display the ERROR. Is there some code I can insert to display PHP errors? All I get is a BLANK white screen.
0
#4 30 Days Ago
Sorry for the late reply, I was at work and got distracted doing, well work
Well your code looks ok to me, could it be that the problem lies in user_list.php with retrieving the $_GET["message"] variable? The only other thing I can think of is that the user level is ok for the access you are trying to attain?
If you don't see error messages in your browser then you aren't actually generating an error, it's just not doing what you want
Well your code looks ok to me, could it be that the problem lies in user_list.php with retrieving the $_GET["message"] variable? The only other thing I can think of is that the user level is ok for the access you are trying to attain?If you don't see error messages in your browser then you aren't actually generating an error, it's just not doing what you want
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend. ![]() |
Similar Threads
- C++ operator== not working properly (C++)
- mail function is not working properly??? (PHP)
- xmldoc.load function not working (JSP)
- Recursive function not fully working (C++)
- print function not working (C++)
- UNIX shell programming. Times function isn't working right (C++)
- BIG Function Help.. (C++)
- tryAgain function not working properly! (C++)
- my php session_destroy() function not working (PHP)
Other Threads in the PHP Forum
- Previous Thread: Please Help Me Fix My PHP Register Form
- Next Thread: Stamp text on an image.
| Thread Tools | Search this Thread |
ajax apache api array back basic beginner binary broken cakephp checkbox class cms code computing cron curl database date delete display dynamic echo email error external file files filter folder form forms function functions gc_maxlifetime google host href htaccess html iframe image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm multiple mysql navigation oop parsing paypal pdf php problem query question radio random recursion regex remote script search server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validation validator variable video web xml youtube





