This is a discussion on "php problem" within the PHP Forum section. This forum, and the thread "php problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
php problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
php problem
Hi,
Is it possible to merge the html form with php code on the one page for file upload and how can I make the uploads for mp3,wav and ppt format on the php code section? If I want to insert a record to this html form and upload php page, is that possible? Any thoughts will be more appreciate! This is the upload form in the html page 'fileupload.html'
|
|
|
|
|||
|
Re: php problem
It's perfectly possible to include the php that processes the form in the same file as your html.
You will have to have the html file parsed by the php parser of course. You can do this by changing the file extention from .html to .php but my prefered method is to keep the .html extention and have an entry in your .htaccess file that tells the server to pass any .html file through the php parser. The 'action' atribute in your in your 'form' element can then just look like action=''. Basically meaning process myself. You will need to add code into the php so that it can tell the difference betwen when the file is just being displayed and when it needs to process the form data. You can upload any type of file using the form method. How you detect the type and process it comes down to your php code. |
|
|||
|
Re: php problem
I have just copied the form action code from html page and pasted it right before the <?php tag and changed it form action code into '<?php echo $_SERVER['PHP_SELF']; ?>'. The uploadfile.php runs the action itself, it works. But I am not sure how to deal with the insert record button once a file uploaded?How do I do this insert string? Thanks for your help.
|
|
|||
|
Re: php problem
Can you be a bit more explicite about what you are doing?
|
|
|||
|
Re: php problem
|
|
|||
|
Re: php problem
What I wanted to do was to insert a record along with uploading file to the artwork table in the database. Obviously I have such hard time to figure out what to do on this insert.php page.
The gallery database contains 3 table below: 1.artwork (id,category(int),media(int), photo) 2.category(id,type) 3.media(id,kind) Quote:
|
![]() |
| Tags |
| problem |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| First image problem and inline list problem | konnor5092 | Web Page Design | 8 | Dec 1st, 2007 09:08 |