#native_company# #native_desc#
#native_cta#

Dynamic Document Search Engine – Part 1 Page 7

By M.Murali Dharan
on February 17, 2004

The following code snippet is the starting place of execution, which calls all the above functions. Here it connects
to database server and database. Initially form() function is called that allows you to enter the title and abstract
of the document.

<?php

if($submit){

    global $allWords;

    mysql_connect"localhost""root""" ) or die( "Unable to connect to database" );

    
mysql_select_db"kpp" ) or die( "Unable to select database" );

    LoadCurrentWords();

    if ( $title and $body){

            
ProcessForm($title ,$body);

        }

}else{ //end of main

       
$err="Please fill in the fields to uploadn";

       
form($err);

}

function form($errmsg)

{  
?>

   <h4 align="center">File Parser & Uploader</h4>

   <b><?php echo $errmsg?></b>

   <center>

   <form method="POST" action=<?php echo $PHP_SELF ?>>

   Title:   <input type="text" name="title" ><p>

   Abstract:   <input type="text" name="body" ><p>

     <input type="submit" name="submit" value="Start Parsing and Upload Content">

   </table>

   </form>

   </center>

<?php

}

?>



1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
|
|
|