I have a php page with a MySQL db behind it which my clients use.
At times I have to add a ‘System Message’ to the top of the page to tell them about planned maintenance or upcoming changes or whatever.
At the moment I do this by opening up the PHP page by FTP and adding a bit of HTML text.
My question is, can you think of a way where I could, for instance, email an address which would take the content of the email and post the text on the Php page as my ‘System Message’?
Or it wouldnt have to be an email, but some hands off way I could add text without opening the FTP or mySQL db – ideally that I could just send from my phone via 3g..
Look forward to your ideas…
I wouldn’t suggest you to use an email, but rather have an admin interface with a
<textarea>or a CKEditor or TinyMCE where you can change the text, click save, and it’d change an external HTML page (custom_content.html) to whatever content you input using post andfile_put_contents("custom_content.html", $_POST["text"]). You’d have to change your main site torequire_onceorinclude_oncethis html page though.If you decide to use the admin system method, either make sure your URL has some sort of uniqueness (random characters) or make a login that you have to fill out before using it first, as both of these methods, if exposed, could be used to XSS attack your site.
That said, if you want the email system (again, I’m not recommending you to), you could have a cron job that connects to your email server with IMAP or POP (using existing libraries) and check for new messages, and if those messages are from a certain email and include a certain subject, and then do the same thing back-end as in the admin system (replacing the HTML files content, and including it on the main page).