Content
function register if (lompty (POST)) ( Smsa If (S POST’I username’ 1) If (POSTI ‘user pasawordnew’ 1) if (SPOSTI ‘userpasawordnew’) wam SPOSTI ‘userpasswordrepeat’ 1) 4 if (otrlen (POST(‘ user pasawordnew’ 1) 5) ( if (atrion (POST ‘unernago’1) 65 Is atrlon (9POST( ‘uBorname 1) 1) ( if (pregmatch((a-2dj (2,64)S1’, SPOSE(‘user name I)) ( Suser – readuser (SPOST (‘user nano 1): If (lisset (Suser( username’ 1)) ( if (9POST( ‘user email1) ( if (atrion (SPOST( ‘useromail’) 65) ( If (filtervar (SPOST udor email’1, FILTERVALIDATEEMAIL)) ( creatousor 0)7 SESSION ‘mag’ ‘You are now registered so please login’: header (‘Locations SSERVER( ‘PHPSELP’1). exit : 0160 Smea You must provide a valid email addross Sing w "Small must be less than 64 charactors’: else Smag a ‘Emafl cannot be empty"; ) else Smog – ‘Usernamo already exists’; olso Smsg ‘Usornamo must bo only a 2, A-2 0-9; Username must be botsoon 2 and 64 charactors" ) else Sang ‘Password must be at least 6 characters’; Passwords do not’ satch: )else Smag Empty Password olso Smog – ‘Empty Username’) S SESSION( ‘mog’ 1 – ) return registerform();