The PHP code segments share variables. All of the <?php ... ?> sequences are part of one program.
x is 5 Back in HTML - lets go into PHP one more time. x is 6 Note that in between <?php ... ?> newlines and whitespace are not significant.
Next: index4.htm