What I am trying to do is
On “Page 1”, user fills a form, and when he clicks on “Submit”,
a new page, say “Page 2” should get automatically created (in the same folder as index.php) in such a way that name of the page is say first_name.php (what the user filled on page 1) and it should display the contents of what he filled in on the first page.
Something like showed in the figure.

showName.php:
This is under the assumption that your form contains an input with
name=nameSo a form like this:
Eventually you might want some validation on the submit, but for now this should suit for what you want to do.
Update:
I read your question more carefully —
You should NEVER do what you proposed it could lead all kinds of attacks and hacks on your site.
You could use a mod-rewrite to seem as if the page went to
john.phpbut really it is showingshowName.php?name=john