Site access before DNS finishes

After I have purchased a new domain or added a domain registered elsewhere, I’d like to run a script, for the sake of simplicity, index.php. I recognize DNS propagation takes 24 hours or more. Because of that I can’t just navigate to xxx.com/index.php because no one knows where xxx.com is. Is there an alternative way for me to run my little index.php script? Like maybe an IP address or a server address?
Thank you.

Thank you.
The solution to immediate access to the database and site is in changing the hosts file on the computer on which the browser is running.

That is one method. The link mentions that method as well as several others.