Re: Will not report errors what can I do

From: Date: Thu, 04 Dec 2008 22:37:58 +0000
Subject: Re: Will not report errors what can I do
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-284121@lists.php.net to get a copy of this message
On Thu, 2008-12-04 at 16:20 -0600, Terion Miller wrote: > Hey everyone I am still fighting the same problem that my script isn't > working and its not reporting errors, when you click to "view" the work > order it doesn't do anything, I have all kinds of error reporting turned on > but nothing, do I have them syntax wrong? > > <?php > include("inc/dbconn_open.php"); > error_reporting(E_ALL); > ini_set('display_errors', '1'); > error_log("errors.txt"); > > > if (empty($_SESSION['AdminLogin']) OR $_SESSION['AdminLogin'] <> > 'OK' ){ > header ("Location: LogOut.php"); > } > > if (isset($_GET['AdminID']) && !empty($_GET['AdminID'])){ > $AdminID = $_GET['AdminID']; > } else { > header ("Location: LogOut.php"); > } > > $query = "SELECT ViewAllWorkOrders FROM admin WHERE > AdminID='$AdminID'"; > $result = mysql_query ($query); > $row = mysql_fetch_object ($result); > if ($row->ViewProjects == "NO") { > header ("Location: Welcome.php?AdminID=$AdminID&msg=Sorry, you do > not have access to that page."); > } > > if (isset($_GET['WorkOrderID'])) {$WorkOrderID = $_GET['WorkOrderID'];} > else > {$WorkOrderID = '';} > if (isset($_GET['ReturnPage'])) {$ReturnPage = $_GET['ReturnPage'];} else > {$ReturnPage = 'Welcome.php';} > > > $sql = "SELECT FormName FROM workorders WHERE > WorkOrderID='$WorkOrderID'"; > $result = mysql_query ($sql); > $row = mysql_fetch_object ($result); > > > if (mysql_num_rows($result) > 0) { > > if ($row->FormName == "WorkOrder") { > header ("Location: > > ViewWorkOrder.php?AdminID=$AdminID&WorkOrderID=$WorkOrderID&ReturnPage=$ReturnPage"); > }elseif ($row->FormName == "PD_Coupon") { > header ("Location: > > ViewPD_Coupon.php?AdminID=$AdminID&WorkOrderID=$WorkOrderID&ReturnPage=$ReturnPage"); > }elseif ($row->FormName == "PD_TextAd") { > header ("Location: > > ViewPD_TextAd.php?AdminID=$AdminID&WorkOrderID=$WorkOrderID&ReturnPage=$ReturnPage"); > }elseif ($row->FormName == "PD_Enhanced") { > header ("Location: > > ViewPD_Enhanced.php?AdminID=$AdminID&WorkOrderID=$WorkOrderID&ReturnPage=$ReturnPage"); > }elseif ($row->FormName == "HS_Builder") { > header ("Location: > > ViewHomescape_Builder.php?AdminID=$AdminID&WorkOrderID=$WorkOrderID&ReturnPage=$ReturnPage"); > }elseif ($row->FormName == "HS_SpecHome") { > header ("Location: > > ViewHomescape_SpecHome.php?AdminID=$AdminID&WorkOrderID=$WorkOrderID&ReturnPage=$ReturnPage"); > } else { > header ("Location: Welcome.php?AdminID=$AdminID&msg=Nothing > works Does it...."); > } > } else { > header ("Location: Welcome.php?AdminID=$AdminID&msg=Nothing > Works..grrrr"); > } > ?> Couple of things to check here: * is the web server working correctly? * do you have permission to set the reporting level (strange but not impossible) * are you sure it's not a logic error in your code rather than a syntax error I notice you're using a LOT of header("Location: ..."); calls, which I'd advise against, but if you must use them, there are sometimes problems when you don't specify the full URL of the page you need to locate to. Ash www.ashleysheridan.co.uk

« previous php.general (#284121) next »