I've added a "Contact" form to a webpage.
It has a "File Upload" field which allows the user to browse their PC for a file and once the "Submit" button is hit, emails the "Contact" details they have filled in along with the file attachment.
Now, I had a bit of trouble getting an Office 2007 .docx file to be accepted but eventually found a list of MIME types relating to Office 2007 and added the variable in for the .docx file type.
However, I would also like a user who has no file they want to upload, simply fill in the other details and have it work that way too when submit is pressed.
But I don't know how to achieve this. At the moment it tells me "Wrong type of file attached" if I leave the file upload feel empty.
I am a complete novice to .php and I dunno what I'm looking for, I assume there is a variable I have to add to the code in the same place I added the one for the .docx file, is that right?.
Don't laff, but I tried :-
Am I along the right sort of lines thinking its something like that or way off the mark?.
It's being sent directly to an email address, its not going into a database on my server btw, if that makes any difference?.
As I said, php newbie, so any assistance appreciated.
It has a "File Upload" field which allows the user to browse their PC for a file and once the "Submit" button is hit, emails the "Contact" details they have filled in along with the file attachment.
Now, I had a bit of trouble getting an Office 2007 .docx file to be accepted but eventually found a list of MIME types relating to Office 2007 and added the variable in for the .docx file type.
However, I would also like a user who has no file they want to upload, simply fill in the other details and have it work that way too when submit is pressed.
But I don't know how to achieve this. At the moment it tells me "Wrong type of file attached" if I leave the file upload feel empty.
I am a complete novice to .php and I dunno what I'm looking for, I assume there is a variable I have to add to the code in the same place I added the one for the .docx file, is that right?.
Don't laff, but I tried :-
Code:
$strresume_type=="none"
Am I along the right sort of lines thinking its something like that or way off the mark?.
It's being sent directly to an email address, its not going into a database on my server btw, if that makes any difference?.
As I said, php newbie, so any assistance appreciated.
