Back | Reverse | Quick Reply | Post Reply |

Need help with php T_T
Link | by Ayu on 2007-01-01 09:29:12
Can anyone please teach me how to do uploading of files using php? T_T I'm currently doing a project on php/mysql. I need to complete this project so my team members and me can graduate...

Anyway, I need to do an upload page with browse and preview buttons, and when the user click on the preview button, it will lead the user to another page, displaying the image. The page that the user is lead to will have 2 buttons, back and insert. If the user clicks , it will go back to the upload page. If the user clicks insert, it will insert the image into database. But then no matter what I do, the code doesn't seem to be able to retrieve the image uploaded. Please help. T_T Thank you.

Re: Need help with php T_T
Link | by gendou on 2007-01-01 13:23:59
read all about it here


Re: Need help with php T_T
Link | by Ayu on 2007-01-02 07:04:48
Eeps... Looks hard X( But still need to try out... T_T Anyway, thanks a lot for helping me out. ^^

Re: Need help with php T_T
Link | by gendou on 2007-01-02 11:28:51 (edited 2007-01-02 11:33:05)
its not that hard. in short, there are three steps:

1. code the HTML form with a files input
2. handle the uploaded file by reading the data from the temp file and inserting it into the database
3. create a display page

for 2, you can use this code for the query, more or less:
INSERT INTO Image VALUES (..., " . addslashes(file_get_contents($_FILES['userfile']['tmp_name']) . " )";



Re: Need help with php T_T
Link | by Kit on 2007-01-06 06:53:48 (edited 2007-01-06 06:58:37)
If you want, I can pass u some of my codes I used before. Even though I copy it from the web. I can't really copy it here, 'cause it's a bit too long.

PS. Mine is to upload image through...

Loneliness have always been my friend...

Until the day I find you...


Back | Reverse | Quick Reply | Post Reply |

Copyright 2000-2025 Gendou | Terms of Use | Page loaded in 0.0009 seconds at 2025-05-07 01:20:47