new_php85 Posted September 22, 2008 Share Posted September 22, 2008 ii... i dont know how to upload file. i tried to search and i still catch up. how ya? plz??? Link to comment https://forums.phpfreaks.com/topic/125268-how-to-upload-file-using-php/ Share on other sites More sharing options...
severndigital Posted September 22, 2008 Share Posted September 22, 2008 this tutorial helped me get the job done .. http://www.htmlgoodies.com/beyond/php/article.php/3472551 Link to comment https://forums.phpfreaks.com/topic/125268-how-to-upload-file-using-php/#findComment-647770 Share on other sites More sharing options...
Brian W Posted September 22, 2008 Share Posted September 22, 2008 once you do some reading and get your form working... shoot me an email or post a new topic and get help on securing it. That is very important. Link to comment https://forums.phpfreaks.com/topic/125268-how-to-upload-file-using-php/#findComment-647776 Share on other sites More sharing options...
new_php85 Posted September 24, 2008 Author Share Posted September 24, 2008 thank you... yes i got it but how come if i need to view uploaded file.because as i know the uploaded files are keep at one folder for example: this is information that i need to save <?php $query = "INSERT INTO pe(staff_id, date_pe, odometer, mileage, receipt, shell, cash, tp_pe) VALUES('$staff_id','$date_pe','$odometer','$mileage','$receipt','$shell','$cash','$tp_pe')"; mysql_query($query) or die('Query failed. ' . mysql_error()); ?> <form name="pe" action='pe.php' method = "post" onSubmit="return validateForm(this,arrFormValidation);"> <table width="679" align="center"> <tr> <td height="20" colspan="2" class="tajukkecil"><b>Petrol Expense</b></td> </tr> <tr> <td width="119">Date</td> <td width="413">: <input class="special" type="text" name = "date_pe" maxlength = "10" size = "16"><a href="javascript:ShowCalendar('document.pe.date_pe',1900,2030,'dd-mm-yyyy');"><img src="pic/ew_calendar.gif"></a> <input class="special" type = "hidden" name = "staff_id" value = "<?php echo $_SESSION['staff_id']?>" Readonly></td> </tr> <tr> <td width="119">Odometer</td> <td width="413">: <input class="special" name = "odometer" maxlength = "7" size = "16"></td> </tr> <tr> <td width="119">Mileage</td> <td width="413">: <input class="special" name = "mileage" maxlength = "200" size = "46"></td> </tr> <tr> <td width="119">Official Receipt No.</td> <td width="413">: <input class="special" name = "receipt" maxlength = "200" size = "16"> Choose a file to upload: <input name="uploadedfile" type="file"> <input type="submit" value="Upload File"></td> </tr> <tr> <td width="119">By Shell Card</td> <td width="413">: RM <input class="special" name = "shell" maxlength = "200" size = "10"> By Cash : RM <input class="special" name = "cash" maxlength = "200" size = "10"></td> </tr> <tr> <td>Toll/Parking</td> <td>: RM <input class="special" type = "float" name = "tp_pe" maxlength = "10" size = "10" value = ""></td> </tr> <tr> <td> </td> <td align="left"><input class="button" type = "button" name = "bttnList" value = "List Petrol Expenses" onClick="listPe()"> <input class="button" type = "submit" name = "bttnAdd" value = "Add"> <input class="button" type = "reset" name = "bttnCancel" value = "Reset"></td> </tr> </table> </form> and then this is for view <?php $y=1; while($row = mysql_fetch_assoc($result)) { ?> <tr> <td><div align="center"><?php echo $y;?></div></td> <td><?php echo $row['date_pe']?></td> <td><div align="left"><?php echo $row['odometer']?></div></td> <td><div align="left"><?php echo $row['mileage']?></div></td> <td><div align="left"><?php echo $row['receipt']?></div></td> <td width="22"><div align="left">RM</div></td> <td width="68"><div align="right"><?php echo round($row['shell'],2)?></div></td> <td width="21"><div align="left">RM</div></td> <td width="32"><div align="right"><?php echo round($row['cash'],2)?></div></td> <td width="23"><div align="left">RM</div></td> <td width="65"><div align="right"><?php echo round($row['tp_pe'],2)?></div></td> <td width="23"><div align="left">RM</div></td> <td width="65"><div align="right"><?php echo round($row['ammount_pe'],2)?></div></td> <td><div align="center"><a href="editPe.php?pe_id=<?php echo $row['pe_id']?>">Edit</a></div></td> <td><div align="center"><a href="deletePe.php?pe_id=<?php echo $row['pe_id']?>">Delete</a></div></td> </tr> <?php $y++; } ?> the how come uploaded file can view??/ Link to comment https://forums.phpfreaks.com/topic/125268-how-to-upload-file-using-php/#findComment-649143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.