Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Auto Delete Record/Send Email After X Hours


What I have is a MySQL database which stores records that each have a date stamp on them (2 of them - one for record created date and one for record last updated date), what I want to do is try and have it so that records that haven't been updated in say 72 hours are automatically removed from the database, or the record is updated to set a flag as being out of date, or an email is sent to alert a user of the out of date record etc.

I can easily write the script with the SQL query to check the records by the datestamp and perform the actions needed if the records are out of date, however that requires someone to physically visit that page to run the script and clean up the out dated records. What I want to try and do is have this happen automatically on its own without someone needing to actually visit the page to run the script.

A good example is on eBay how emails are sent to you to let you know when your auctions are about to expire, i wouldnt imagine that eBay would rely on people visiting their website to make those queries run on the database so there must be a way of doing some automated script executio or having a scheduled task run on the server to have a PHP script run each day at midnight or something? Anyone know how to do this?




View Complete Forum Thread with Replies

Related Forum Messages:
Auto Email Send Using PHP
Ive set up a simple email sender for my site. When people register they are sent an activation email so they can enter and browse my site. however the email thingy isnt working properly. Heres the code i have so far:

mail($email,$subject,$emailmessage,$headers);

I have assigned the variables as usual previously in the code:

View Replies !
How To: Send Email Upon Insert Of Record.
I have a small and modest scheduling web app that I wrote using PHP (v.3) and MySQL. I would like to add the feature of emailing one or multiple accounts whenever a record is added to a table - tblSchedule. The server that my app runs on supports PHP 3 and 4, MySQL, and Sendmail I believe.

View Replies !
Delete Record - When The Delete Link Is Clicked The Next Page Is Blank And Nothing Is Deleted.
This is my "delete.php" and this "todo/delete.php?id=64" an example of a link to it generated from the index.php page. When the delete link is clicked the next page is blank and nothing is deleted. What have I done wrong?

<?
include("dbinfo.inc.php");

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$id="delete from todo where id='$id'";
mysql_query($id);

mysql_close();
?>

View Replies !
Delete Files Every X Hours
I need a simple snippet that'd point me in the right direction on how to delete all the files inside a folder every __ hours.

View Replies !
Delete Query Takes HOURS
why on EARTH would this query: Code:

DELETE FROM `test_zip_assoc` WHERE id > 100000

take an entire day when there are 10 million records in this database:


Code:
+--------------+------------------+------+-----+---------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+------------------+------+-----+---------------+----------------+
| id | int(12) unsigned | | PRI | NULL | auto_increment |
| f_id | int(12) unsigned | | | 0 | |
| zip | varchar(5) | | | | |
| lat_radians | decimal(12,11) | | MUL | 0.00000000000 | |
| long_radians | decimal(12,11) | | MUL | 0.00000000000 | |
+--------------+------------------+------+-----+---------------+----------------+

View Replies !
Send Email - Page Where You Enter An Email Address And Click Send.
I am interested in creating an "email -this" type ability for a website. I am sure most people have seen an "email -this story" type link that is standard on most news web sites. You click such a link and then it takes you to a page where you enter an email address and click send. The link for the story and the title are not editable. Does anyone know where I can find example code of how to do this with php, and any explanation of how this works.

View Replies !
Auto Delete
This script was meant to delete a file after X days...in this case I wanted it to delete files that were older than 1 day except .htaccess. what the script is doing is deleting everything in the specified folders except htaccess even though the files are less than a day old. any suggestions? Code:

View Replies !
How To Auto Delete Table Row?
I Have A Page On My Site That The Database Outputs To. There Is A User That I Dont Want To Ban Yet , But I Do Want To Block Or auto Delete His Data. Now When Everyone Post New Data The Only Table That Would identify Them Is The Username Table, There Is No Member ID Table.

Now I Would Like To querry The Database And Auto Delete Table (Username) BOBBY And The Row BOBBY Posted , So There Is No Data Output To My Site Page For BOBBY. Can Someone Give Me A Couple Codes To Try, And I Would Think The Code Would Need To Be On A New Page That I Need To Make Up Right?

View Replies !
Database Auto Count What About Delete?
I have a table that give a unique ID to certain Articles.
To give the ID i simply use the Auto count of the DB.

But what happens when i delete a record? i am now missing an ID.
How can i insert a row and give it the first available number?

For example ID 1, 2, 4, 5, 6

i would Insert and set the ID number to 3.

View Replies !
Delete Record
i have this code for my site that will connect to my database and grab all my members there id email and ip the problem is that it dont have a button where you can select a member and delete that member can anyone help me with this?i want to add a button and a check box so if i check off a member and click a delete button it will delete that member here is the code:

View Replies !
Delete Record!
I am using PHP5 , MySQL5, Apache 2 My Database was created with phpmyAdmin.Then I inserted with script and phpmyAdmin data into the Database. Now I am Unable to empty or delete or remove any fields out of the Database. Neither a script ot phpmyAdmin can delete.What has blocked the database? I have restarted my pc, Still I am unable to remove anything.

View Replies !
Updating Auto Increment Field After Deleting A Record
So much for thinking MySql is smart, but what's an easy way to update an auto increment field after deleting a record. the code is below, please help, specifically part 3 is where the magic happens. thanks in advance. by the way id is the name of the auto increment field. Code:

View Replies !
Delete Record And Files
I have a code that uploads images along with some info into a directory and database, this all works fine. I can delete the record but the images relevent to that record continue to exsist in my images directory. How would i set up a php code to delete a file in ../images when the record of its name is stored in a column in my database. Here is my delete record code:

View Replies !
Mysql Delete Record
when I run this code below it doesn't delete the record or display any error message

$id = $_GET['id'];
include("../dbconnect.php");
mysql_query("DELETE FROM promotions WHERE id='$id'") or die(mysql_error());

Such a simple thing to do but I don't no why it doesn't work 

View Replies !
Unable To Delete A Record Using Php
I am having a form which displays a couple of values from database and a delete button which is used to delete that particular record. Below is the code that I am using, but I am unable to delete the record. Please help me to get the record deleted. Code:

View Replies !
Confirmation When Delete A Record
I want to add a confirmation before I delete a record. For example if the user wants to delete they press "Yes" otherwise "NO" and go back.

<?php

//delete user
$sSQL = "DELETE FROM user WHERE (`userid` = ".$_GET['record_id'].")";

$result = mysql_query($sSQL) or die(mysql_error());

echo "<h1> User deleted succesfully</h1><br>";

?>

View Replies !
Auto Delete Date Based Calendar Events
Out of both wanting to improve my PHP skills and necessity, I created my own small CMS for a non-profit site I am involved with. One of the features I have is an event calendar where other users can submit  events, which then go into a "holding tank" until I can approve or deleted them. It's working great and everyone is loving it... but I have discovered one issue. When the date of the event passes, I have to log into the admin area and manually remove it. I am actually not deleting it from the database but changing a field variable and archiving it for our records.

I have been trying the past few days to come up with the necessary PHP to automatically check the current date (today's date) against all the calendar events and remove ones that have already happened. I could then hook this up to a CHRON action in my hosting CPanel and call it a day - at least that is how it all plays out in my head. 

I imagine in order to point me in the right direction you will need some information about my database.

View Replies !
Delete Record - You Have An Error In Your SQL Syntax;
Im some having  trouble with deleting a record, surely it isnt that hard, dont know what im doing wrong. this is the error i am gettin:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '` WHERE id=1' at line 1Here is my delete code:

View Replies !
Delete Record If Older Than 5 Minutes?
Can someone help me in writing a query command, to delete a record, if the last_update field on a record is older than 5 minutes?

My table has a last_update field, which holds a value as this for example: 2007-04-08 01:33:12

I need a query that when I access a php file, if a record is older than 5 minutes, it will delete it.

View Replies !
Click Link To Delete Record
I am trying to add a function to one of my scripts.  I would like to be able to click a link and have it delete a particular row from by DB.  Links are generated by a PHP script and are based on entries on a DB.  In this DB I have a column called 'users'.  The table is generated by the following snippet: Code:

View Replies !
Using Checkboxes To Delete Record From Database
i would like to use check boxes to delete records from the database. my problem is, the records belong to different tables. how do i indicate in my code "DELETE from blah blah... " from which table to delete from..

View Replies !
How To Send Email Automaticly To Admin When Users Send A Form?
how to send email automaticly to admin when users send a form....example...a booking form..therefore the admin will alert of the booking..

View Replies !
Auto Delete The Old Records But What If Server Clock Was Set Up Wrong In Maintenance?
I want auto delete any events that the event date is at least 1 day older than current date. No problem for the php programming. get the current data (server clock), check the events date and delete the old records. My problem is that for some very rare cases.

Say if for extrem cases I have 1000 new events saved in database. But somehow, I or the the hosting company do the server maintenance, and reset the time clock of the server, in case in the maintenace, the server time clock was set up wrong say 2005, was set up as 2006. Code:

View Replies !
Find Difference In Hours- Edit Code From Days To Hours?
I'm trying to find the difference in hours between one date from another, and my code currently finds the difference in days- could somebody edit the code to use hours instead of days?

$expirationdate[0] = $row3[datetillcompletion];
$startdate[0] = date('Y-m-d');
$startdate = strtotime($startdate[0]);
$expirationdate = strtotime($expirationdate[0]);
$delta = $expirationdate - $startdate;
$final=round($delta/86400);

View Replies !
Auto Send Variables
I want to be able to set certain variables on a php page and automagically send to another php page as a post_var for handling. I have an environment using php agi and want to send from there to a script that will send an email.

View Replies !
Dreamweaver Generated Code To Delete Record
I use the dreamweaver generated code to delete a record, how would i add some code to it to delete the files (images) stored in my../images folder, that are linked to the record being deleted, there field names are photo1, photo2, ect..... and there image names are stored in the database Code:

View Replies !
Send Over Thousand Email, How To Make Script As Not Email Spam?
I want to make a same script in PHP for send mail to my customer. Over
15.000 email in the list. How to pause 2 sec after sending 100
messages as this site? and continue sending email until send message in
all emails???

What's idea? do you have exist script? Please give me a solution?

View Replies !
Email Problem ( I Am Unable To Send Email In Diffarent Language )
I want to send the mail in Russian language. The mail content has two part, 1st part comes from database, and other part is entered by user in russian language. I am using UTF-8 in database.

I am also used Utf-8 (<meta http-equiv="Content-Type" content="text/html; charset=utf-8" in all web page. My site and  is working perfectly.

But I am unable to send mail in diffarent language. The mail is send well, but I am getting the mail with unicode chrecter of the language instade of original language. Code:

View Replies !
Grab Email Addresses From MySQL And Send An Email....
I am making a simple mail form that will SELECT email address from a MySQL table based on the userid of the person sending the email.

if (isset($_POST['submit'])) {
require('../database.php');
$result = mysql_query("SELECT * FROM emailList WHERE merchantId = '".$_SESSION['id']."'") or die(mysql_error());

What would be the most efficient way of storing the email addresses from MySQL (may be 1 or may be 100) and then sending them in BCC to all the people gathered from the MySQL table?

View Replies !
Send A Mass Email From A Database Of Email Addresses
Im trying to send a mass email from a database of email addresses. basically, once a user signs up, their email is inserted into  table in the database. I would liek to make a link that i can click form the backend that says "send out newsletter" this would take all the emails in the database and put them in outlook ( mail app for me), seperate each with a comma and then i could compose a message. here's what i have come up with so far..
//Once connected to database

$mailto = mysql_query("SELECT * FROM newsletter");
while($row = mysql_fetch_array($mailto))
  {
echo "<a href=">. $row['email'] ."/">Send out Newsletter</a>";

}
Ive had it working but obviously it s making each email a seperate link that says "send out newsletter" i would like it to be one link that combines all the emails in a "mailto:" format.

View Replies !
Send A Email With Html As Well As Php.sending The Email
im trying to send a email with html as well as php.sending the email is the easy part.the problem is with the message part.if i put this code in the textarea it display the html tags in the email.yet the php is fine. Code:

View Replies !
Email -auto-responder
How would it be possible to set up a system that receives an email to a particular email address and then responds with an appropriate attachment?  For instance if you want the latest schedule for something.  You will email schedule@organization.com and then receive an email back with the latest schedule. Is that possible to do in php?

View Replies !
Auto Email Greeting In PHP To Members
I am looking to build an PHP application which will automatically send
birthday greeting email to subscribers. The content of that email will
change from time to time. Please help. Links to tutorial to accomplish
this objective is very much appreciated.

View Replies !
How Do You Email From A Record?
I am using PHP to pull up records from a MySQL database onto an HTML page. The records are simply name, telephone number, email address etc.

What I want is, after every record is a checkbox. You tick as many boxes as you like and then press a button at the bottom of a page which opens your email client with all the email addresses of the people you have clicked in the 'to' line. How do you do this please?

View Replies !
How To Send Email In PHP If I Do Not Have Email Server?
I have a PHP/MYSQL system on IIS. I am trying to make my system send emails but I do not know how. I do have an email server but it is not on the same machine that my PHP system is at.

View Replies !
How To Send PHP Email To 100+ Email Addresses
I have a script that send out html email and I have over 100 email address from people who would like to join my newsletter. But I cannot get my script to email all 100+ of these people. Any one know how I can do this? Code:

View Replies !
Email : Send To Email In Recordset
My script sends email fine when I have a hard-coded email address but when I try to dynamically change the email recipient based on the results of a recordset, the email script fails. Code:

View Replies !
Stripping Html Tags From Auto Response Email
I've got a form setup to pass variables from flash to a sql table using php, the php sends the varaibles to the table and sends me and the user notification email.

Everything works great but in the email I get forward slashes appearing where the line should break, anyone knows how to strip the html tags in php? Code:

View Replies !
Delete Email
i use this code to delete a specific email. PHP Code:

$do = $pop3->delete_mail ($delid);
        if ($do == false) {
                echo $pop3->error;
        }
        
        echo 'message deleted'

View Replies !
Inset Record And Email Conformation
I have a form that i would like to Inset record and email conformation to me of a new user. i am using wmdformmailer.php for sending emails.

i have tried using sessons to carry the data to a new page with an onLoad  submit form on it  but that didn't work the data is not carry ing a cross i checked the [$HTTP_POST_VARS['Title'];] and that the form properties said [POST] but still nothing.

View Replies !
Email Delete Function
Im looking for ideas on writing a function or finding one that would delete table content based on email being returned based on either unsubscribe or on email bouncing. I am just in the organization phase of writing this script.

View Replies !
Email Form That Uses Array And A Switch Call To Send Values In A Form To My Email
I've got a email form that uses array and a switch call to send values in a form to my email. The problem I'm having is I have a checkbox where users should be able to select multiple values however if they do when I receive the email instead of having the values it prints "ARRAY"...I've included a sample below: PHP Code:

<?
// Key => (required, type, string)

// Types:
// 1 - Long text
// 2 - Short text
// 3 - Textarea
// 4 - Radio
// 5 - Checkbox
// 6 - Dropdown

// 4, 5, and 6 require a 4th value in the array
$mail_form_to = "me@email.com";
$mail_form_subject = "Real Estate Submission";

View Replies !
Dates 23.00 Hours To 0.00 Hours.
I have the following code

$day1 = mktime (0,0,0,1,1,$year);
$days = ($week - 1) * 7;
$d = strtotime ("+$days days", $day1);
$dow = date('w', $d);
$sunday = strtotime ("-$dow days", $d);
$saturday = strtotime ("+6 days", $sunday);

to give me the timestamp on sunday and saturday for a given week and year. The problem I have is that it's giving it at 23.00 hours when i need it at 0.00 hours.

1179010800 translates to Saturday, May 12th 2007, 23:00:00 (GMT)

Can anyone see the problem?

View Replies !
How To Delete Single Email Adres From Text File
I have a textfile:

bla@domain.com
blabla@domain2.com
haha@domain.com
la@domain3.com
zaza@domain4.com

How can I delete a single email from that text file ? E.g. I want to delete blabla@domain2.com so that the textfile will be:

bla@domain.com
haha@domain.com
la@domain3.com
zaza@domain4.com

How can this be done ??

View Replies !
Using Php To Send An Email
I would like to know if anyone has experience with using PHP to email a stored password out of a mySQL database. I have a mySQL database which I allow users to connect thourgh PHP web pages and I want to provide the option to email the users password which is stored in the database. Could anyone show me the code to do this or explain where I need to look up to find the information. Thanks in advance for the help!

View Replies !
Cannot Send Email To Myself
I run Apache 2.0.59 and php 5 on WindowsXP.
Server works OK. But I cannot receive the email with the results of the
form.
I made changes in php.ini file, changing [mail function]

SMTP = outgoing.verizon.net
sendmail_from= myE-mailAddress@verizonnet

where outgoing.verizon.net is the actual ISP server name (I found it in
outlook express accounts)

The form has been processed without errors, but I didn't receive any
email. Could you please help me with this problem?

View Replies !
Can't Send Email Through PHP
I am trying to send email through PHP, i used the following code and it seems working every lines...but i can't really get a email from this..

$from="Frankie";
$contents="hello ...how r u ar";
$subject="helo";
$to = "frankie@aristo.com.hk";
$from_header = "From: $from";

print("mailing");
mail($to, $subject, "", $from_header);
print("sent");

View Replies !
How To Send An Email
Hi I want to know how i can send email to my customer list in a specific time for example every morning at around 10:00 am my server will send them email containing articles from my database. I want the server to be able to send email to my customers in a specific time everyday without human interaction.... is there a way to do this?

View Replies !
Send Email To AOL Via PHP?
I have code that sends email to customers via PHP mail() but the mail never gets to AOL customers.  I looked at the headers of two different emails - one sent from the same hosting service/domain with SquirrelMail and the other via PHP.  I see some differences that I am sure are related to why AOL is blocking the emails but I cannot seem to get the Return-Path to override from the PHP - I tried. Code:

View Replies !
Send An Email
I'm trying to set a script to send an email with information from a form. It's quite simple ... I got various  sample scripts from internet , but when i run them , i get the message "mesage sent" but i never get the mail ..

View Replies !
Can't Send Email To
i'm trying to run the following code but i have always the same return "FALSE". Can anyone help me figer out way i have always the same message : 'Can't send email to ' and he send the email like spam:

#!/usr/local/bin/php

<?php
if (mail("nelson@estudoplase.pt","teste","nelson@eusei.com.pt")) {
echo "<h4>Thank you for sending email</h4>";
} else {
echo "<h4>Can't send email to $email</h4>";
}
?>


View Replies !
Send Out Email
I would like to write a script which sends out emails every Tuesday at 12:00pm. I wrote the following code, but it didn't work. Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved