This script is for members of a website to upgrade to a paid account: Here you can see how it works from the member's point of view: go to www.yasserferas.nl/members/upgrade.php log in: test / test The member who now has a free account gets to choose from 2 options for upgrading to a paid account, these options are loaded from table ACCOUNT_OPTIONS (called TAO from here) Member chooses first displayed option, which is access_type 2 Member clicks on Upgrade my account now Then his details are fetched from table MEMBERS (called TM from now on) and he gets sent to the Epoch payment page (pop up window) This needs to be changed: Member clicks on Upgrade my account now: This script first adds a record to table ACCOUNTS (called TA from now on), with these details: Date, TM/member_id TM/username, TM/password, access_type, TAO/level, TAO/sites (SP / RO / YF), TAO/PP (payment_processor), TAO/duration, TAO/rebill and sets STATUS to 'pending' Once the record is created, from this record the member is sent to Epoch (in same browser tab) for making payment, together with his username and password and email. If there is more than one record with status PENDING, use the most recent one. This is already working: If the payment is succesful, Epoch will send return to script passmanage.php and set the pending record to active, and then the member has his paid account. So you don't have to implement any Epoch scripts here, that's already taken care off. The record is checked 30 minutes later, if status is still PENDING, it is set to FAILED The script that needs to be updated and the database with relevant tables are attached to this project. Please make comments inside the script there were you modify it. My maximum budget is $100 and work has to be fully completed before Monday midnight CET.