Welcome to Virtual Tutorial World Guest!



Create a Simple Form

 
Post new topic   Reply to topic    VTW Forum Index -> HTML
View previous topic :: View next topic  
Author Message
Please Register and Login to this forum to stop seeing this advertsing.





Tokens:


Posted:     Post subject:

Back to top
computergeek67
Administrator
Administrator


Joined: 31 Jul 2007
Posts: 144


Tokens: 147
Location: US

PostPosted: Tue Oct 23, 2007 4:58 pm    Post subject: Create a Simple Form Reply with quote

Forms are the fastest and easiest way to add interactivity to your site. I am going to teach you how to build a simple submit form. Paste this code:
Code:
<html>
<head>
<title>File Uploading Form</title>
</head>
<body>
<h3>File Upload:</h3>
Select a file to upload: <br />
<form action="/php/file_uploader.php" method="post"
                        endtype="multipart/form-data">
<input type="file" name="file" size="50" />
<br />
<input type="submit" value="Upload File" />
</form>
</body>
</html>

You will notice that it links to an external PHP file called "file_uploader.php". This is what file_uploader.php lookes like:
Code:
<?php
if( $_FILES['file']['name'] != "" )
{
   copy( $_FILES['file']['name'], "/var/www/html" ) or
           die( "Could not copy file!");
}
else
{
    die("No file specified!");
}
?>
<html>
<head>
<title>Uploading Complete</title>
</head>
<body>
<h2>Uploaded File Info:</h2>
<ul>
<li>Sent file: <?php echo $_FILES['file']['name'];  ?>
<li>File size: <?php echo $_FILES['file']['size'];  ?> bytes
<li>File type: <?php echo $_FILES['file']['type'];  ?>
</ul>
</body>
</html>

Now when you upload a file, you should get the following result:
Uploaded File Info:

  • Sent file: uploadedfile.txt
  • File size: 2003 bytes
  • File type: image/jpg

-Tutorialspoint.com
_________________



Come to me if you have any questions
Back to top
View user's profile Send private message Visit poster's website
evanescence
Newbie
Newbie


Joined: 28 Oct 2007
Posts: 12


Tokens: 12


PostPosted: Sun Oct 28, 2007 5:07 pm    Post subject: Reply with quote

ooh far too complicated for me lol!!!!



_________________
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    VTW Forum Index -> HTML All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Card File  Gallery  Forum Archive
Powered by phpBB © 2001, 2005 phpBB Group
Virtual Tutorial World ©2007-2008 computergeek67

Affiliates