
February 6th, 2003, 06:18 AM
|
|
Junior Member
|
|
Join Date: Feb 2003
Posts: 12
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Dealing with files from a form in PHP
here's a little script I made just to see if I could work out how to handle files from a HTML form:
<form name="form1" enctype="multipart/form-data" method="post" action="?action=do">
<input type="file" name="file"><br>
<input type="text" name="text"><br>
<input type="submit" name="Submit" value="Submit">
</form>
PHP Code:
<?
$action = $HTTP_GET_VARS['action'];
$file = $_POST['file'];
$text = $_POST['text'];
if ($action=="do")
{
echo($file);
echo($text);
}
?>
the echho($text) works perfectly, but my server gives me the response 'PHP Notice: Undefined index: file in S:\WebSites\WaterLines\www\_file.php on line 23'
I'm trying to write a script that includes uploading and making a thumbnail of images that are added from a form, but I'm not sure how to go about this at all.
If anyone has any suggestions I won't burn their houses down.
Last edited by SpontaneousTree : February 6th, 2003 at 06:28 AM.
|