[thelist] Running php scripts from an email

Marek Kilimajer kilimajer at webglobe.sk
Mon Oct 13 10:31:54 CDT 2003


You don't need any of those, just working php. In your alert email 
provide yourself a link that will point to a php script on your site 
that will delete the offending post:

http://yoursite.net/delete_post?post_id=2234&secret_string=asdui34238d

The secret string can be just one for all posts all for added security 
generate new one for each post.

If you have admin interface you might not need to do even that, jast 
mail yourself the same link that is in the admin interface.

Dunstan Orchard wrote:

> Hi there,
> 
> When someone posts a comment to my blog (not that that happens very often) my
> php scripts send me an email alerting me of the event.
> 
> If the comment is spam I'd like to be able to reply to the email and have my
> server run another php script to delete that record from my mysql db.
> 
> Is that possible given that I'd have the db row id of the comment in question?
> 
> Can anyone get me started in the right direction (or stop me in my tracks if
> it's impossible)?
> 
> I see this article at evolt:
> http://www.evolt.org/article/Incoming_Mail_and_PHP/18/27914/
> 
> Is says I need three things:
> 
> [1] PHP compiled as a CGI binary, not just as an Apache module;
> [2] a local mail system or MTA, (are you using Sendmail, Exim, Qmail or some
> other system);
> [3] shell access to your server, whether or not you have to be root depends on
> your mail system.
> 
> My PHP_INFO() says:
> PHP GATEWAY_INTERFACE is CGI/1.1
> does that cover [1]?
> 
> I have sendmail on my system, so that covers [2].
> 
> I don't have shell access, does anyone know how I can get around this for [3]?
> 
> 
> The server is running Apache, MYSQL, PHP.
> 
> 
> Thanks for any advice,
> 
> - Dunstan
> 
> ---------------------------
> Dorset, England
> http://www.1976design.com/
> http://www.1976design.com/blog/



More information about the thelist mailing list