file inputs/upload

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nincha
Forum Contributor
Posts: 191
Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA

file inputs/upload

Post by nincha »

i got a form that sends a file to another php script

Code: Select all

<form name="test" enctype="multipart/form-data" method="post" action="testing3.php">
	<input type="file" name="file1"><input type="submit" name="submit" value="test"></form>
now in testing3.php i can acess the filename by using the variable file1_name, but i would like to access it with some other variable so i can use a loop.. Can some one tell me the syntax to do this. And also, why cant i access file1 by using $_POST['file1']? Thnx lots
and
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Code: Select all

<?php
$file = trim($file1);
// now $file is in an easier form to work with
?>
Last edited by m3mn0n on Fri Apr 25, 2003 7:16 pm, edited 1 time in total.
nincha
Forum Contributor
Posts: 191
Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA

Post by nincha »

nevermind u guys....i figured it out :oops: thnx alot though
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

...i updated the snipplet, used trim()instead.
Post Reply