Function Not Working...Little help

View: New views
2 Messages — Rating Filter:   Alert me  

Function Not Working...Little help

by dwdc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
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

by Ashley Sheridan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
> 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