/[libdata]/branches/paul/publish.phtml
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /branches/paul/publish.phtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 67 - (hide annotations)
Thu Mar 18 19:24:54 2004 UTC (20 years, 1 month ago) by dpavlin
File size: 996 byte(s)
updated to libdata 2.00

1 dpavlin 1 <?php
2     // Load globals
3     require_once ("global_vars.php");
4    
5     // Includes
6     require_once ("db_connect.php");
7     require_once ("public_controls.php");
8    
9     // Cast as integer to be sure
10     $page_id = (int) $page_id;
11    
12     // Error flag
13     $err_code = 0;
14    
15     // Continue only if we now have a valid page
16     if ($page_id > 0 ) {
17    
18     // Check to see if it exists first
19     $exists = 0;
20 dpavlin 67 $exists = existsRow("page", "page_id", $page_id);
21 dpavlin 1
22     if ($exists > 0) {
23    
24     // Build the SQL to extract the static snapshot
25     $sql = "SELECT pageHTML from page WHERE page_id = " . $page_id;
26 dpavlin 67 $rs = mysql_tryquery($sql);
27     $row = mysql_fetch_array ($rs, MYSQL_ASSOC);
28 dpavlin 1
29     // Fetch data
30     $pageHTML = $row["pageHTML"];
31    
32     // Dump the page
33     if (strlen($pageHTML) > 0) printf("%s", $pageHTML);
34     else $err_code = 1; // No data. Unpublished page?
35     }
36     else $err_code = 2; // Page ID doesn't exist.
37     }
38    
39     else $err_code = 3; // Invalid incoming page ID.
40    
41    
42     // Generic error message. May be customized.
43     if ($err_code > 0) {
44    
45     printf("Page not found...");
46    
47     }
48     ?>

  ViewVC Help
Powered by ViewVC 1.1.26