Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting after expiration...

Status
Not open for further replies.

perlone

Programmer
Joined
May 20, 2001
Messages
438
Location
US
Hi,

I have a DBM file called "activation.db". It contains all the users that need to activate their account. But i need to delete each user if no activation is logged within 5 days. I tried the following but getting me an internal server error.


$expiration = 1;
dbmopen(%activation. "activation", 0644);
if (-M > $expiration) {
delete $activation{email};
delete $activation{pass};
delete $activation{fname};
delete $activation{lname};
delete $activation{ugender};
delete $activation{gender};
delete $activation{username};
delete $activation{byear};
delete $activation{model};
dbmclose(%activation);

 
this may be to simple.... but,
you don't appear to be closing your braces...
dbmopen(%activation. "activation", 0644);
if (-M > $expiration) {
delete $activation{email};
delete $activation{pass};
delete $activation{fname};
delete $activation{lname};
delete $activation{ugender};
delete $activation{gender};
delete $activation{username};
delete $activation{byear};
delete $activation{model}};
dbmclose(%activation);

HTH


keep the rudder amid ship and beware the odd typo
 
Ok, I tried the following and it seems to work. Thanks again.


$expire = 1;
dbmopen(%activation, "activation", 0644);
if (-M $activation{email} > $expire) {
delete $activation{email};
delete $activation{pass};
delete $activation{fname};
delete $activation{lname};
delete $activation{ugender};
delete $activation{gender};
delete $activation{username};
delete $activation{byear};
delete $activation{model};
delete $activation{code};
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top