Normally it is best to put a session_start() at or near the beginning of your script. You may not start a session after any HTML output. No HTML tags like <html> or <body> can be sent but the below is fine
<?php
session_start();
?>
<form name='myform' action='next.php' method='post'>
Enter Name: <input type='text' name='name' /><br />
Blah Blah: <input type='text' name='blah' /><br />
<input type='submit' name='register' value='register' />
<?php
//More php code
$_SESSION['name']=$_POST['name'];
//more php code
?>
You can assign variables or even read them after HTML has been output but the session_start() function sends a header to the browser and must come before using HTML and also must be used to assign or read $_SESSION variables.