Re: Function Not Working...Little help
| From: | Ashley Sheridan | Date: | Fri, 06 Nov 2009 10:41:29 +0000 |
| Subject: | Re: Function Not Working...Little help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299676@lists.php.net to get a copy of 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@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