SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast Pure L's Avatar
    Join Date
    Oct 2007
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    paypal verification then database update

    Hi all.

    Just wondering what the best way to go about this is.

    I'm working on a site that has a paypal "buy now" button which, when clicked, submits a form to paypal. After the checkout has occured the form is verified by paypal using Instant Payment Notification. I have a php script that reads the the IPN notification and then redirects to the "membership confirmation" page.

    On this page, I'd like to enter the member's join date (today) in a field plus enter their join date + one year to another field.

    What would be the most efficient PHP code to do this? Thanks!

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    insert into memberships (userid, startDate, endDate) values (1234, CURRENT_DATE, CURRENT_DATE + interval 1 year)
    http://dev.mysql.com/doc/refman/5.0/...functions.html

  3. #3
    SitePoint Enthusiast rgf207's Avatar
    Join Date
    Feb 2006
    Location
    Maryland
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by crmalibu View Post
    Code:
    insert into memberships (userid, startDate, endDate) values (1234, CURRENT_DATE, CURRENT_DATE + interval 1 year)
    http://dev.mysql.com/doc/refman/5.0/...functions.html
    I'm not sure if that would work exactly. I thought it had to be like this

    Code:
    insert into memberships (userid, startDate, endDate) values (1234, CURRENT_DATE, DATE_ADD(CURRENT_DATE,INTERVAL + 1 year));

  4. #4
    SitePoint Wizard REMIYA's Avatar
    Join Date
    May 2005
    Posts
    1,351
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    According to me the best way is to use the PHP time function in order to set startTime and endTime

    PHP Code:
    $start_time time();
    $end_time time() +  (365 *  24 *  60 *  60); 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •