Hi I'm a new student and starting to learn coding/programming specially on PHP. I tried learning some code and I have encountered this problem.
This page isn’t working
localhost redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS
and this is my code:
session_start();
include('_includes/config.php');
include('_includes/db.php');
if(isset($_POST['register'])){
$_SESSION['uname'] = $_POST['uname'];
$_SESSION['fname'] = $_POST['fname'];
$_SESSION['lname'] = $_POST['lname'];
$_SESSION['email'] = $_POST['email'];
$_SESSION['address'] = $_POST['address'];
$_SESSION['postal'] = $_POST['postal'];
$_SESSION['pass'] = $_POST['pass'];
$_SESSION['con-pass'] = $_POST['con-pass'];
}
if(strlen($_POST['uname'])<3){
header("Location:register.php?err=" . urlencode("The username must be at least 3 characters long"));
die();
}
I really don't know what to do I have encountered some errors in php but I haven't encountered this kind of error PLEASE HELP and PLEASE ENLIGHTEN me on what I have done wrong.