I know some things wont work as these funcs was put together quickly, no tutorial was used for these, i just did what i know and did plan to fix................
Yes sorry, the session is created in init.php
you've lost me here: "
Fix the problem with the $_SESSION['user_id'] = $reg; by assigning $reg to something, and then see what it does.", this $_SESSION['user_id'] = $reg; - is created in register.php?