PHPBuilder - Dynamic Document Search Engine - Part 1 Page 7



RSS Twitter
Articles Tricks And Hacks

Dynamic Document Search Engine - Part 1 - Page 7

by: M.Murali Dharan
|
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 upload\n";
       
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
}
?>

« Previous Page
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
M.Murali Dharan

Comment:



Comment:

(Maximum characters: 1200). You have characters left.