[PHP] execute script via email?

2004-04-06 Thread BigMark
Is there a way for me to email this script so it executes the close of a
round instead of doing it from the website administration .

(it is a football tipping script)


?php
include(connect.php);

// Grab variables and insert into database
$x=1;
$Round = $_POST['Round'];

switch ($Round) {
 case QF:
  $y = 5;
  break;
 case SF:
 case PF:
  $y = 3;
  break;
 case GF:
  $y = 2;
  break;
 default:
  $y = 9;
  break;
}

While ($x  $y) {

 $Game = $x;
 $sql = mysql_query(UPDATE Rounds SET Closed = 'Yes' WHERE Round = '$Round'
AND Game = '$Game');
 $x++;

}
?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] execute script via email?

2004-04-06 Thread jon roig
Sure... You can write a small php script that uses PHP's imap or pop
functions to monitor any email address. (Check out
http://us3.php.net/manual/en/ref.imap.php for details.) Once that's
written, just schedule it as a task using the windows scheduler or cron
in unix/linux.

-- jon

---
jon roig
web developer
email: [EMAIL PROTECTED]
phone: 888.230.7557



-Original Message-
From: BigMark [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 06, 2004 6:27 AM
To: [EMAIL PROTECTED]
Subject: [PHP] execute script via email?


Is there a way for me to email this script so it executes the close of a
round instead of doing it from the website administration .

(it is a football tipping script)


?php
include(connect.php);

// Grab variables and insert into database
$x=1;
$Round = $_POST['Round'];

switch ($Round) {
 case QF:
  $y = 5;
  break;
 case SF:
 case PF:
  $y = 3;
  break;
 case GF:
  $y = 2;
  break;
 default:
  $y = 9;
  break;
}

While ($x  $y) {

 $Game = $x;
 $sql = mysql_query(UPDATE Rounds SET Closed = 'Yes' WHERE Round =
'$Round' AND Game = '$Game');  $x++;

}
?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.644 / Virus Database: 412 - Release Date: 3/26/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.644 / Virus Database: 412 - Release Date: 3/26/2004
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php