PHP - how to script multilevel referal page - Asked By Olusegun A. on 04-Feb-10 05:33 AM

Hello please i need a help on how to script a multilevel referal page. I want it to be that when a member (Eg. Mike) register, he is on level 1, when he refer someone(Eg. Nelson) he(Mike) should move to level 2 and Nelson in level 1. when Nelson refer another person(Eg. Clitton), Clitton should be in level one, Nelson should move to level 2 and Mike should move to level 3 automatically.

Gayathri S replied to Olusegun A. on 13-Jul-10 12:05 PM
This is the perfect example of the tree data structure. You need to implement a tree data structure in PHP and store the levels using a recursive procedure ( current_height = 1 + height_of_parent and height of leaf node = 0 )

For more information, refer to tutorials regarding the tree data structure.