
Originally Posted by
DrByte
I meant literally exactly that.
The die() function will halt execution and display whatever message you put in between the brackets.
So, since *you* know what line you put the die() message on, *you* will know exactly how far the code got.
And if you get a blank page (500 error) you will know that the code didn't finish all the way to the line where you put the die() statement, and then you can narrow things down to wherever the actual problem is occurring. And then fix it.
You could also replace it with die('I got to ' . __LINE__ . ' in ' . __FILE__); but the line number will only be meaningful to *you* since only *you* know what changes you've made to various lines in your file. (my point here is that telling "us" what line number may not be useful since you're changing the code in order to do these tests)
Thank you DrByte. I got as far as line 353 without triggering the 500 internal server error. The code around that line looks like this with my addition for testing purpose:
PHP Code:
<?php
require(DIR_WS_INCLUDES . 'header.php');
die('it got this far');
?>
</div>
After this point is where thing starts to break. Whatever is triggering my 500 internal server error lines somewhere here:
PHP Code:
<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<!-- body_text //-->
<?php if ($action == '') { ?>
<!-- search -->
<tr>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr><?php echo zen_draw_form('search', FILENAME_ORDERS, '', 'get', '', true); ?>
<td width="65%" class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
<td colspan="2" class="smallText" align="right">
<?php
// show reset search
if ((isset($_GET['search']) && zen_not_null($_GET['search'])) or $_GET['cID'] !='') {
echo '<a href="' . zen_href_link(FILENAME_ORDERS, '', 'NONSSL') . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a><br />';
}
?>
<?php
echo HEADING_TITLE_SEARCH_DETAIL . ' ' . zen_draw_input_field('search') . zen_hide_session_id();
if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
$keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
echo '<br/ >' . TEXT_INFO_SEARCH_DETAIL_FILTER . $keywords;
}
?>
Not exactly sure looking at the above line what's causing the issue but at least I know line 1-353 is NOT my problem. Any insight as to what may be my issue in the above code? I don't even see anything that have to do with Gift Certificate which is the scenario I am able to use to trigger the internal server error.
Bookmarks