[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 12-14-2005, 08:30 AM   #1 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Caution $5 USD for a working script

Hello,

I need a PHP script that goes through all rows in a table and:

A) If the field "last_login" is 20 days old or more, it sends an email to the user, email field being "email" notifying that he/she has 10 days to do login to his/her account to keep it from being deleted.

B) DELETES the row if the "last_login" field is 30 days old or more.

The catch? This must be tested on YOUR OWN SERVER!

I want to see a WORKING SAMPLE - this script is for www.VirtualDN.com - and I simply cannot risk a script glitch on my own server.

The dates are stored in this PHP date() format: F d, Y

That's:

February 02, 2005

...similar to that. Convert it if you must but I need it to be bug-free.

Thanks for anybody who can do this... $5 will be sent via PayPal to a working script.
-Matt
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 12-14-2005, 08:52 AM   #2 (permalink)
sjp
NamePros Member
 
sjp's Avatar
 
Join Date: Oct 2005
Location: Andromeda
Posts: 136
369.50 NP$ (Donate)

sjp is on a distinguished road


You didn't give enough information (name of the user, mysql type of the date, database type, ...) but you can use this to create your own script:

PHP Code:
<?

$link
= mysql_connect('localhost', 'root', '');

if (!
$link)
{
    die(
"Can't connect: " . mysql_error());
}
else
{
    
mysql_select_db('foo');

    echo
"Deleting users who didn't log in during the last 30 days<br />";
    
    
mysql_query("delete from user_table where date_sub(curdate(), interval 30 day) > last_login");
    
    
$result = mysql_query("select id, email from user_table where date_sub(curdate(), interval 20 day) > last_login");
    
    if (!
$result)
    {
        die(
"Error: Invalid query: " . mysql_error());
    }
    
    echo
"Sending mail top users who didn't log in during the last twenty days:<br />";
    
    while (
$row = mysql_fetch_assoc($result))
    {
        if (
mail($row['email'], "Log in", "Or your account is killed"))
        {
            echo
'Sent mail to user with ID ' . $row['id'] . "<br />";
        }
        else
        {
            echo
'Mailing user with ID ' . $row['id'] . " failed <br />";
        }
    }
}

?>
sjp is offline  
Old 12-14-2005, 12:14 PM   #3 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
I told you the type of date - F d, Y which really only fits in VARCHAR... use some logic. Database type... MySQL .... really: What other database system implements w/ PHP so well and is used so commonly?

I am not willing to buy a script from somebody that does not know what they're doing. Please write an original script for you to get your $5 - again it must be tested on your own server.
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 12-14-2005, 12:20 PM   #4 (permalink)
sjp
NamePros Member
 
sjp's Avatar
 
Join Date: Oct 2005
Location: Andromeda
Posts: 136
369.50 NP$ (Donate)

sjp is on a distinguished road


Quote:
Originally Posted by compuXP
I am not willing to buy a script from somebody that does not know what they're doing.
I really appreciate 15 year olds who store timedate stamps in varchar fields telling me I don't know what I'm doing. The script works well (assuming you knew how to set up database tables, which you unfortunately don't) and it's tested on my server.

Edit: Here, because I'm a nice guy: Look into the MySQL cast operator to create a workaround for your horrible table design. Something like "select cast(last_login as date) from table". Maybe you're lucky and that works.

Last edited by sjp; 12-14-2005 at 12:27 PM.
sjp is offline  
Old 12-14-2005, 01:00 PM   #5 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
I'm glad you appreciate the fact that I told you that you don't know what you're doing. Your welcome.

And, obviously you don't know what you're doing since I specifically ask that I see a sample of it.

Now bug off and I would appreciate it if somebody else could follow my criteria.
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 12-14-2005, 02:32 PM   #6 (permalink)
NamePros Member
 
Join Date: Dec 2005
Posts: 99
32.30 NP$ (Donate)

UKMatt is an unknown quantity at this point


lol

lol, after talking to him like that ... do you really expect someone to help you ???
UKMatt is offline  
Old 12-14-2005, 03:14 PM   #7 (permalink)
mch
NamePros Regular
 
Join Date: Nov 2005
Location: EU
Posts: 248
99.25 NP$ (Donate)

mch is on a distinguished road


Yeah, you need to post the table structure at least. And honestly, if this is such a critical thing for you (and obviously it is and you can't risk screwing up your server/database/site), I think you should offer more.

BTW, sjp's solutions looks fine to me (different coding style, though ).
mch is offline  
Old 12-14-2005, 03:17 PM   #8 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Table structure ... why? I give you the fields that are used ...
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 12-16-2005, 01:50 PM   #9 (permalink)
jdk
Senior Member
 
jdk's Avatar
 
Join Date: Jul 2004
Location: Florida
Posts: 1,223
306.40 NP$ (Donate)

jdk is a name known to alljdk is a name known to alljdk is a name known to alljdk is a name known to alljdk is a name known to alljdk is a name known to all


Wow, very interesting thread. Let me get right on this for you.
__________________
All bids are valid for 24 hours unless otherwise stated.
jdk is offline  
Old 12-16-2005, 01:57 PM   #10 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
THANK you! Many thanks again. I look forward to seeing your results
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 12-18-2005, 04:38 PM   #11 (permalink)
DNOA Member
 
mholt's Avatar
 
Join Date: May 2004
Location: Utah
Posts: 5,041
18.01 NP$ (Donate)

mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future

Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Any progress?

Btw, jdk, how am I supposed to reply to your PM when you have disabled Private Messages?
__________________
codeboards

A high-quality community of programmers -- Join today and post! We want new members!
mholt is offline  
Old 12-18-2005, 04:58 PM   #12 (permalink)
jdk
Senior Member
 
jdk's Avatar
 
Join Date: Jul 2004
Location: Florida
Posts: 1,223
306.40 NP$ (Donate)

jdk is a name known to alljdk is a name known to alljdk is a name known to alljdk is a name known to alljdk is a name known to alljdk is a name known to all


I sent an email to tech to find out why since in my options it says they are enabled.
__________________
All bids are valid for 24 hours unless otherwise stated.
jdk is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Huge Script Pack for $5 with Resale Rights dsforsaken Scripts For Sale 32 12-03-2005 08:46 PM
[urgent] Help! Mass_Add script not working for olate WuLabsWuTecH Programming 0 04-23-2005 02:49 PM
Domain Parking Script ezimedia Parking & Traffic Monetization 3 03-02-2004 11:17 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 09:05 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85