Well on my site ive got a timetable for dj's and every sunday I want slots that arnt set to permanent deleted ready for the next week. Now im not sure were to start! but heck ill give it a try.
<?php
include("config.php");
$admin = ('Skycaptain')
$date = date('Ymd');
$username = mysql_query("select * from timetable where perm = 'no'");
//sends them a pm saying there slot was deleted (Seperetly)
$send = mysql_query("INSERT INTO `pmessages` ( `title` , `message` ,
`touser` , `from` , `unread` ,
`date` ) VALUES ('Your Slot(s)', 'Dear $username your slot(s) has expired and was deleted, <br>if you want to add it again or as a permanent slot please do so by <Br><a href=\"timetable/submit_show.php\">Clicking Here</a>', '$username',
'$admin', 'unread', NOW())");
//sends a pm to admin (Togethor)
$send = mysql_query("INSERT INTO `pmessages` ( `title` , `message` ,
`touser` , `from` , `unread` ,
`date` ) VALUES ('Non-Perm Slots', '$username s slots were deleted Successfully', '$admin',
'Slot Bot', 'unread', NOW())");
//deletes the non permanent slots
$reset = mysql_query("DELETE FROM timetable WHERE perm='no'");
?>
I Also want it to send a private message to them telling them it was deleted.
Saved as "cron.php" saved in public html / spanel .
And I want it to do this every sunday at midnight.
I know were to go in cpanel to add cron but how to i do it.
<?php
include("config.php");
$admin = ('Skycaptain')
$date = date('Ymd');
$username = mysql_query("select * from timetable where perm = 'no'");
//sends them a pm saying there slot was deleted (Seperetly)
$send = mysql_query("INSERT INTO `pmessages` ( `title` , `message` ,
`touser` , `from` , `unread` ,
`date` ) VALUES ('Your Slot(s)', 'Dear $username your slot(s) has expired and was deleted, <br>if you want to add it again or as a permanent slot please do so by <Br><a href=\"timetable/submit_show.php\">Clicking Here</a>', '$username',
'$admin', 'unread', NOW())");
//sends a pm to admin (Togethor)
$send = mysql_query("INSERT INTO `pmessages` ( `title` , `message` ,
`touser` , `from` , `unread` ,
`date` ) VALUES ('Non-Perm Slots', '$username s slots were deleted Successfully', '$admin',
'Slot Bot', 'unread', NOW())");
//deletes the non permanent slots
$reset = mysql_query("DELETE FROM timetable WHERE perm='no'");
?>
I Also want it to send a private message to them telling them it was deleted.
Saved as "cron.php" saved in public html / spanel .
And I want it to do this every sunday at midnight.
I know were to go in cpanel to add cron but how to i do it.
Comment