| | |
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 Nov 5th, 2009
•
•
•
•
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 Nov 6th, 2009
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.
Views: 213 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax alexa apache api array beginner beneath binary broadband broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion redirect regex remote script search select server sessions sms smtp soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube





