HTML
  Home arrow HTML arrow Page 5 - Completing Construction of a Database Form...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Completing Construction of a Database Form with HTML
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-10-08

    Table of Contents:
  • Completing Construction of a Database Form with HTML
  • The Body Element
  • The Third Main Row
  • The Last Two Rows
  • Cgi-bin Directory
  • Brief Explanation of the Web Page Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Completing Construction of a Database Form with HTML - Cgi-bin Directory


    (Page 5 of 6 )

    Create a directory called cgi-bin in the highest directory of your site. Copy the code below into your text editor, and save the resulting file in the cgi-bin directory; name the file receiveData.pl. This is the code:


    use CGI;

     

    $cgi = new CGI;


    $error = $cgi->cgi_error;


    open DESTINATION, ">store.txt";


    $cgi->save(DESTINATION);


    close DESTINATION;



    $filename0 = $cgi->upload('Pi03');

    $path0 = ">";

    open (OUTFILE,$path0);

    while ($bytesread=read($filename0,$buffer,1024))

    {

    print OUTFILE $buffer;

    }

    close OUTFILE;


    $filename1 = $cgi->upload('Pi13');

    $path1 = ">";

    open (OUTFILE,$path1);

    while ($bytesread=read($filename1,$buffer,1024))

    {

    print OUTFILE $buffer;

    }

    close OUTFILE;


    $filename2 = $cgi->upload('Pi23');

    $path2 = ">";

    open (OUTFILE,$path2);

    while ($bytesread=read($filename2,$buffer,1024))

    {

    print OUTFILE $buffer;

    }

    close OUTFILE;


    $filename3 = $cgi->upload('Pi33');

    $path3 = ">";

    open (OUTFILE,$path3);

    while ($bytesread=read($filename3,$buffer,1024))

    {

    print OUTFILE $buffer;

    }

    close OUTFILE;


    $filename4 = $cgi->upload('Pi43');

    $path4 = ">";

    open (OUTFILE,$path4);

    while ($bytesread=read($filename4,$buffer,1024))

    {

    print OUTFILE $buffer;

    }

    close OUTFILE;




    if ($error)

    {

    print $cgi->header(-status=>$error),

    $cgi->start_html('Problems'),

    $cgi->h2('Request not processed'),

    $cgi->strong($error);

    exit 0;

    }

    else

    {

    print "Content-Type: text/htmlnn";

    print "<HTML>n";

    print "<HEAD>n";

    print "<TITLE>Thanks</TITLE>n";

    print "</HEAD>n";

    print "<BODY>n";

    print "<H1>Thank You</H1>n";

    print "<H2>Your message has been sent</H2>n";

    print "</BODY>n";

    print "</HTML>n";

    }


    If you are using a Unix, Linux or similar operating system, then precede the above code with the line:

    #!/usr/local/bin/perl

    which is the path to your Perl interpreter (modify it if necessary).

    When you are through, open the web page and link the five image files to the five Input File controls of the web page (using the corresponding Browse buttons). Click the Save button. A new web page should appear, telling you that your message has been received.

    Now open the cgi-bin directory. You should see a file called “store.txt.” This file has been created by the receiveData.pl program, which received the data. You should also see five other files, which represent the five different images; more on these later.

    More HTML Articles
    More By Chrysanthus Forcha


       · We are finally there. After this, you will be able to enter a new world of database...
     

    HTML ARTICLES

    - Hello HTML 5, Goodbye Gears
    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers







    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek