Go to Post Look at the success of the Banebot's gearboxes this year. Cheap, light, small, and a lot of people are using them, even though their quality may be a bit questionable... Make a similar gearbox for a drivetrain (with a bit more robustness) and I think you've got a winner. - Ben Piecuch [more]
Home
Go Back   Chief Delphi > Other > Chit-Chat
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 10-09-2002, 18:42
DanL DanL is offline
Crusty Mentor
FRC #0097
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Somerville, MA
Posts: 682
DanL is just really niceDanL is just really niceDanL is just really niceDanL is just really niceDanL is just really nice
Send a message via AIM to DanL
...or if you wanna take the cheap-n-easy dan way out....

dump this into a file and name it upload.html:
PHP Code:
<html><head><title>PHP's FileUPLOAD</title></head><body>
<form enctype="multipart/form-data" action="upload.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="500000">
Username: <input type="text" name="user" size="10"> <br>
Password: <input type="password" name="pw" size="10"><br>
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
</body>
</html> 
and name this upload.php
PHP Code:
<?php 
if ($user != "ian"  ||  $pw != "is_hot")
    exit();

// In PHP earlier then 4.1.0, $HTTP_POST_FILES  should be used instead of $_FILES.
if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
    
copy($_FILES['userfile']['tmp_name'], "uploads/".$_FILES['userfile']['name']);
    echo 
"upload success!";
} else {
    echo 
"Possible file upload attack. Filename: " $_FILES['userfile']['name']
    .
"<br>(<a href=\"http://www.php.net/manual/en/features.file-upload.errors.php\">error code</a> "$_FILES['userfile']['error'] .")";
}
?>
That basically uploads the file to a directory called "uploads" in the php script directory (you have to make it) when the username is "ian" and the pw is "is_hot". This is quick, dirty, but it should work (if you have the newer php version and didn't set a crazy anti-global directive thing in the php config file, you need to change the first php line to:
if ($_POST['user'] != "ian" || $_POST['pw'] != "smells")
for more info, go here and here
__________________
Dan L
Team 97 Mentor
Software Engineer, Vecna Technologies

Last edited by DanL : 10-09-2002 at 18:50.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Sharing and Revision Tracking Madison FIRST-related Organizations 14 04-06-2003 18:01
php vs. perl Jack Website Design/Showcase 20 29-12-2002 17:01
Dashv2.ocx dependency file now available archiver 2000 0 23-06-2002 22:00
What's better, PERL/cgi or PHP/my_sql? mikefrei Programming 10 27-05-2002 22:50
Improving PBASIC: Request for Comments Greg Ross Programming 19 16-02-2002 22:14


All times are GMT -5. The time now is 02:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi