maybe hide the file input and write the value to it with js? Here’s what I want to do:
I have a MySQL database in which staff can compose a press release, then select press contacts from another table, and then send the press release via automated emails to all of the selected contacts.
I have a MS Access client for staff to work with the linked MySQL tables. But instead of using VBA to send the emails from the client machine, I’m using PHP to send the emails from the server, because it keeps MS Office from interfering. I have a button on my Access form that uses a hyperlink command to open a browser and send a GET string to a web page. All working great, but now I’m thinking I’d like to have the Access client create a file (maybe a PDF) from the Press Release data that gets pasted into the email body, and attach that file to the email also. I am onto PHPMailer for sending the email with the attachment.
But is there a way to send the file upload data along with the GET? I’m betting not. I can send the file path along in the GET string too, and I can use PHP to print its value into a form’s hidden file input. But then can I somehow redirect to the “ACTION” attribute of the form, without making the user click a button? Can I do it all behind the scenes, and take the user straight to a page that displays results of the script? I’m having trouble because the code I know for redirecting only works if there’s no output yet, and so the form input won’t have the value in it yet, or rather, the form won’t exist yet at the time of redirect…
Just tell me “Get over it. The user has to click a button on the web page after they click a button on your Access form…” Unless you know a secret.
thanks!