upload attachment function.....HELP ME!!!!due date 11/11/06!
Posted: Thu Nov 09, 2006 4:08 am
JayBird | Please use
JayBird | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi guys, I need some help here .....i don't seem to find a way to make this happen ...my project is a simple task management system....my problem is how do insert all the task details simultaneously with attach documents below....because in this file, there are 2 forms which is 1st to insert the task details, 2nd is to upload attachment...both work well if filed seperately...but now I need to attach the uploaded document to the respective Task_ID...FYI Task_ID is an auto increment...any suggestion to simplify the function or reconstruct my code would be helpful..I know my code is a mess...here is my some code in Add_Task.php...Code: Select all
<?
session_start();
?>
<? $User_ID =$_SESSION['User_ID'];?>
<?php include("config.php");?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>ADD NEW TASK</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<tr>
<td height="546"></td>
<td colspan="2" valign="top" bgcolor="#0066FF"><form name="form1" method="post" action="After_Add_Task.php">
<table width="100%" border="1">
<tr bordercolor="#000000">
<td width="18%"><strong>Date Assigned</strong></td>
<td width="2%">:</td>
<td width="80%"><input type="text" name="Date_Assigned" value="<? print(date("dS F, Y")); ?>" readonly="true"></td>
</tr>
<tr bordercolor="#000000">
<td width="18%"><strong>Due Date </strong></td>
<td width="2%">:</td>
<td width="80%"><input type="text" name="Due_Date" size="20" value="<? printf($Due_Date);?>" ></td>
</tr>
<tr bordercolor="#000000">
<td width="18%"><strong>Raised By</strong></td>
<td width="2%">:</td>
<td width="80%"><input type="text" name="Raised_By" value="<?php print($User_ID);?>" readonly="true"></td>
</tr>
<tr bordercolor="#000000">
<td width="18%"><strong>Status</strong></td>
<td width="2%">:</td>
<td width="80%"><SELECT name="Status">
<OPTION SELECTED>New</OPTION>
<OPTION>Pending</OPTION>
<OPTION>Completed</OPTION>
</SELECT></td>
</tr>
<tr bordercolor="#000000">
<td width="18%"><strong>Priority</strong></td>
<td width="2%">:</td>
<td width="80%"><SELECT name="Priority">
<OPTION SELECTED>High</OPTION>
<OPTION>Medium</OPTION>
<OPTION>Low</OPTION>
</SELECT></td>
</tr>
<tr bordercolor="#000000">
<td width="18%"><strong>Assigned To</strong></td>
<td width="2%">:</td>
<td width="80%"><SELECT name="Assigned_To">
<?
$result = mysql_query("select * from user");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<option value="<? echo $row["User_ID"];?>"><? echo $row["User_ID"];?></option>
<?
}
mysql_free_result($result);
?>
</SELECT></td>
</tr>
<tr bordercolor="#000000">
<td width="18%"><strong>Description</strong></td>
<td width="2%">:</td>
<td width="80%"><textarea name="Description" rows=7 cols=70></textarea></td>
</tr>
<tr bordercolor="#000000">
<td width="18%"><strong>Remarks</strong></td>
<td width="2%">:</td>
<td width="80%"><textarea name="Remarks" rows=7 cols=70></textarea></td>
</tr>
<tr bordercolor="#000000">
<td width="18%"><strong>Attachment</strong></td>
<td width="2%">:</td>
<td width="80%">
</td>
</tr>
<p></p>
</table>
<label for="file">Filename:</label>
<form enctype="multipart/form-data" action="2.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
<input name="button" type="file" value="Browse"/>
<input type="submit" value="Send File" />
<input type="submit" name="button" value="Submit">
<input type="submit" name="button" value="Cancel">
<input type="submit" name="button" value="Reset">
</form></td>
<td></td>
<td></td>
</tr>
</body>
</html>JayBird | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]