\n"; $returns_text = ''; $title_text = "Clock Return Policy from Bill's Clocksorks"; $description_text = "Clock Return Policy from Bill's Clockworks"; if ($url_parameter == 0) { $sql = "SELECT * FROM return_policy WHERE name = 'Default' LIMIT 1"; //echo "sql: $sql
\n"; $result_returns = query($sql) or die(mysqli_connect_errno()); $row_returns = mysqli_fetch_assoc($result_returns); $returns_text = Markdown::defaultTransform($row_returns['description']); } else { $sql = "SELECT * FROM return_policy WHERE id = $url_parameter AND name != 'Default' AND enable = 1"; $result_returns = query($sql) or die(mysqli_connect_errno()); if (mysqli_num_rows($result_returns) == 0) { // if no returns selected, show default $sql = "SELECT * FROM return_policy WHERE name = 'Default' LIMIT 1"; //echo "sql: $sql
\n"; $result_returns = query($sql) or die(mysqli_connect_errno()); $row_returns = mysqli_fetch_assoc($result_returns); $returns_text = Markdown::defaultTransform($row_returns['description']); } else { $row_returns = mysqli_fetch_assoc($result_returns); $returns_text = Markdown::defaultTransform($row_returns['description']); $title_text = $row_returns['name'] . ' Return Policy'; $description_text =$row_returns['name'] . " Return Policy from Bill's Clockworks"; } } mysqli_free_result($result_returns); ob_start(); // turn on output buffering (to generate content-length header) ?> <?php echo $title_text?>