chuckdraws Posted September 29, 2009 Share Posted September 29, 2009 Hello, I was wondering where I'd start at (noob at PHP) to get a file uploading .php script. What I want in it is for the person uploading to select a date from a drop-down menu. Then the file uploaded will be in .doc format, and we need to strip the contents of this (preferrably formatted) and put it into a certain section of an html file. In other words, I need to replace the content area of an html file with the contents of the doc file. The date selection is so we know what file to change the contents of (e.g. Monday, September 28th 2009 will replace monday.html, and so on). I'm great at html coding and css and everything design-wise, but I need help when it comes to server-scripting. Thanks. Link to comment https://forums.phpfreaks.com/topic/175937-file-uploaded-from-doc-to-html/ Share on other sites More sharing options...
zq29 Posted September 29, 2009 Share Posted September 29, 2009 There is a section in the manual that covers this nicely: PHP: Handling file uploads As far as modifying your html files, you could use the following functions: file_get_contents() preg_replace() fopen() fwrite() fclose() You'll need to use a Regular Expression with preg_replace, regular-expressions.info is a great resource for this. Although, I would suggest you look into how you could achieve the desired result with the use of a database, rather than updating your HTML files. Link to comment https://forums.phpfreaks.com/topic/175937-file-uploaded-from-doc-to-html/#findComment-927066 Share on other sites More sharing options...
chuckdraws Posted September 29, 2009 Author Share Posted September 29, 2009 Thanks for the info, it really helps a lot. I knew about file_get_contents(), but wasn't sure about the other four. As for the database, that's what me and my mentor originally wanted to do, but we have no direct access to the server, and thus no access to a database that we can set up. There is a database, but it's set up for an alumni registry, and that's out of the question. So we want an uploading form that the secretary can submit a file and set the date. Then the server will convert accordingly. Again, thanks a million for the info. Link to comment https://forums.phpfreaks.com/topic/175937-file-uploaded-from-doc-to-html/#findComment-927312 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.