How can i header user to his profile page when he logs in.I have got this code

```
$way="user/$userName.php";
$file="main.php";
$m= file_get_contents($file);
if(!file_exists("$way")){
    file_put_contents($way, $m);
}

```

So when new user registers it creates new file for him