How to execute an external script when new user joins?

Discussion in 'Customization & add-ons' started by tomfra, Feb 5, 2007.

  1. tomfra

    tomfra Member

    Joined:
    Dec 21, 2006
    Messages:
    199
    Hi everyone,

    I am quite new to Amember Pro so there is a chance there is something like that mentioned in the manual and I simply haven't found it yet...

    When a new user subscribes to my product, I'd like Amember to "trigger" / run an external PHP script. The external script could, for example, add the user info into a separate database (beside the Amember one, not instead) etc.

    What's the best way to accomplish this with Amember? I'd like to use a solution that is not wrecked after upgrade.

    Thanks!

    Tomas
  2. alex

    alex aMember Pro Customer Staff Member

    Joined:
    Jan 24, 2004
    Messages:
    6,021
  3. tomfra

    tomfra Member

    Joined:
    Dec 21, 2006
    Messages:
    199
    I'll read the whole page, but it seems to be easy to understand for me and well written. By the way, you have a coding error in the first example. Some missing brackets and the strlen function is missing an argument. I know I know... ;)

    Tomas
  4. jenolan

    jenolan aMember Coder

    Joined:
    Nov 3, 2006
    Messages:
    510
    Making a specific plugin would do it, but the question to ask is that aMember already has the details why flip them somewhere else?

    You can easily check whether someone has a subscription current or am I missing something?
  5. tomfra

    tomfra Member

    Joined:
    Dec 21, 2006
    Messages:
    199
    jenolan,

    Amember already has *some* of the details I need for my "external" script to work. For example I need the user password in crypted MD5 format and then add the username together with the crypted password (by "crypted", in this case, I mean created with the PHP crypt() function although it will be one way hashed in fact) into a text file.

    Of course, this is just one way to do it. Another way would be to set Cron to periodically "scan" the Amember database and extract the necessary info. It's just that the first way seems to be somewhat "cleaner" to me.

    Tomas
  6. jenolan

    jenolan aMember Coder

    Joined:
    Nov 3, 2006
    Messages:
    510
    Yah but this sounds as though you are building a user file (svn?) for access to something. What happens when you cancel access in aMember that's why I suggested a plugin as the add/remove is part of a plugin and does all the work.

    If you are building a secondary user access widget the cron might be the way to go if you do not want to go the plugin way. To help more I would need to understand more of the backend, ie non-aMember, stuff you want to do so I could make a reasoned reply.

    Cheers .. Larry

Share This Page