Themen / Inhalte 
   Forschungsaufgaben
   neueste Einträge
   Suche
   Power-Suche

 Wiki-Infos 
   Einleitung
   allgem. Hinweise
   Quick-Formate
   Formatierungsregeln


Integration with yoursite.php

For the next few paragraphs the "yoursite.php" refers to whatever
files and/or scripts belong to your already existing website. This
hypothetical script should at least output the <html><body> tags
around the output from ewiki. The most simple script to accomplish
this could look like this (see also example-2.php):

    <?php
       mysql_connect("localhost", "DB-USER-NAME", "PASSWORD");     
       mysql_query("use DATABASE-NAME-HERE");

       define("EWIKI_SCRIPT", "yoursite.php?page=");               
       include_once("ewiki.php");                                  
    ?>
    <HTML>
     <head>...</head>
    <BODY>
    <?php
       echo  ewiki_page();                                         
    ?>
    </BODY>
    </HTML>

1+  The first two commands open a connection to your MySQL database.
Usually one saves the result of mysql_connect() in a variable named
$db or so, but that was not used in "ewiki.php" at all (because PHP
does not depend on it if there is only a single db connection).

2+  The define line tells ewiki about the <a href= hyperlinks it
shall create for wiki pages.

3+  The include_once("ewiki.php") finally loads the ewiki "library" and
sets any EWIKI_ constants that have not already been defined here. Instead
of "include" we use the safer "include_once" since version R1.02b

4+  The final call to the ewiki_page() function returns the wiki page
which was requested by the browser as <html> string. The "echo" command
lets PHP print it out.
prev << "Integration with yoursite.php"
next >> "What to do if images don't work"


You cannot modify the README file, but anyhow any ideas or suggestion should as usually get filed on BugReports, UserSuggestions or even better the README.Discussion.


Sühnekreuze & Mordsteine