Function Not Working...Little help

Function Not Working...Little help

am 06.11.2009 02:50:08 von Don Wieland

Hello,

I am trying to get this function working but it gives me a PHP error
(blank page):

function Validate_Page_Nav($LastPage, $ErrorPage) {

$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($_SESSION['Last_Page'] != $LastPage}) {
header("location: {$ErrorPage}?message=Unable to update user
information.");
exit();
}

if(in_array($_SESSION['Staff_level'], $URI_access)) {
echo "Access";
exit();
}else{
echo "No Access";
//header("location: {$ErrorPage}?message=Unable to update user
information.");
exit();
}
}

Validate_Page_Nav("user_list.php", "user_list.php");

There are parts of the code I was trying to debug.

Any help would be appreciated.

Don Wieland
D W D a t a C o n c e p t s
~~~~~~~~~~~~~~~~~~~~~~~~~
donw@dwdataconcepts.com
Direct Line - (949) 305-2771

Integrated data solutions to fit your business needs.

Need assistance in dialing in your FileMaker solution? Check out our
Developer Support Plan at:
http://www.dwdataconcepts.com/DevSup.html

Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro
9 or higher
http://www.appointment10.com

For a quick overview -
http://www.appointment10.com/Appt10_Promo/Overview.html


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Function Not Working...Little help

am 06.11.2009 11:41:29 von Ashley Sheridan

--=-qWkNOzSRb7h4agesdgrI
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Thu, 2009-11-05 at 17:50 -0800, Don Wieland wrote:

> Hello,
>
> I am trying to get this function working but it gives me a PHP error
> (blank page):
>
> function Validate_Page_Nav($LastPage, $ErrorPage) {
>
> $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($_SESSION['Last_Page'] != $LastPage}) {
> header("location: {$ErrorPage}?message=Unable to update user
> information.");
> exit();
> }
>
> if(in_array($_SESSION['Staff_level'], $URI_access)) {
> echo "Access";
> exit();
> }else{
> echo "No Access";
> //header("location: {$ErrorPage}?message=Unable to update user
> information.");
> exit();
> }
> }
>
> Validate_Page_Nav("user_list.php", "user_list.php");
>
> There are parts of the code I was trying to debug.
>
> Any help would be appreciated.
>
> Don Wieland
> D W D a t a C o n c e p t s
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> donw@dwdataconcepts.com
> Direct Line - (949) 305-2771
>
> Integrated data solutions to fit your business needs.
>
> Need assistance in dialing in your FileMaker solution? Check out our
> Developer Support Plan at:
> http://www.dwdataconcepts.com/DevSup.html
>
> Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro
> 9 or higher
> http://www.appointment10.com
>
> For a quick overview -
> http://www.appointment10.com/Appt10_Promo/Overview.html
>
>


You have an extra } after the $LastPage variable in the first if
statement

Thanks,
Ash
http://www.ashleysheridan.co.uk



--=-qWkNOzSRb7h4agesdgrI--