Content
function register if (lompty (POST)) ( Smsa If (SPOST’I username’ 1) 1f (POST( ‘user passwordnew’ 1) if (POSTI ‘user pasawordnew’) wan SPOSTI ‘userpasawordrepeat’ I). ( if (strlen ( POST(‘ usor pasaword new’ 1) 5) ( if (atrion (POST ‘username’1) 65 Is atrlon(9POST( ‘usorname’1) 1) ( if (pregmatch( (a-qd) (2,64)S1’, S POST(‘ username 1)) ( – readuser (POST(‘ usernano 1); If (lisset (Suser( username 1)) ( if (6 POST( ‘useremail’1) ( if (atrion(POST(‘usoromall’l) 65) ( Af (filtervar (POST ‘usor email’1, FILTERVALIDNTEEMAIL)) ( creatousor ()7 SESSION ‘mag’) ‘You are now registored so please login’; header (‘Location: SSERVER( ‘PHPSELP’1) 7 0160 Smear You must provide a valid email addrose ) elso Smug – ‘Email must be less than 64 characters; jolso Smog a Sell cannot be esoty? )else Snag – ‘Username already exists’; olso Smsg ‘Usornamo must bo only a-2, A-2, 0-9; Username must bo botwoon 2 and 64 chaesctors"A ) else Sag "Password must be at least 6 characters’; else Smsg Passworde do not satch: )else Smag – Empty Password olso Smsg Empty Username; S SESSION( ‘mog’1 – ) return registerform();