Welcome to Geeklog, Anonymous Wednesday, February 05 2025 @ 11:35 pm EST

Geeklog Forums

static pages and database


lean4huskytop

Anonymous
I would like to create a static page that connects to the database and sends the form results there. Can you give me any code? I am a php programmer, but I just cant get the static pages to exist with my code. I looked at the documentation but still cant get it to work. Can ANYONE give me a static page code example with PHP and database? thanks in advance Paul www.PolishTrainer.com
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
You can also create it as an external page and rap it around by Geeklog, using External Page plugin. Another way is to wrap the Geeklog around your custom code. See below,
The simplest form of Geeklog integration is to wrap the Geeklog portal around your custom code. It\'s quite easy to accomplish that. You need to do the following: Add an include of the main geeklog library - lib-common that is in the public_html directory. We will then use a few of the COM functions in that program. Example: require_once(\"../lib-common.php\"); // This may need to change - depending on the Path for where you are calling this from Now lets call the main header and display the right blocks. This is all done with one call. echo COM_siteHeader(); If you don\'t want the left blocks the use COM_siteHeader(\'none\'); Now you would include your main custom code or custom content. To show the right blocks (optional) and the footer. echo COM_siteFooter(); Or to not show the right blocks use: COM_siteFooter(false);
Sam
 Quote

lean4huskytop

Anonymous
artistic
thanks I will try this out tonight....going out for my guitar lesson now Smile
 Quote

Status: offline

DTrumbower

Forum User
Moderator
Registered: 01/08/03
Posts: 507
Within a static page.
Text Formatted Code
$results = db_query("select * from gl_users",1);
$rows = DB_numRows($results);
$display="<table>";
for ($i=0; $i< $rows; $i++) {
    $row = DB_fetchArray($results) ;
    $display .= "<tr><td>".$row['username']."</td>";
    $display .="<td>".$row['uid']."</td></tr>";
}
$display .= "</table>";
return $display;
 Quote

All times are EST. The time is now 11:35 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content