At this point, your questions indicate that you really need to step back a bit and take at least an introductory PHP tutorial, or get a book on PHP. I can't really undertake to teach you PHP in forum exchanges; it would be just too painful.
Essentially, you create a PHP file in a text editor, enter PHP code into that text file, and save the file with a .php extension.
You FTP that file to your web server, and reference it just like an html file (you can browse to it in a browser, link to it, etc.). The details of how to build a PHP file is what you need to study, or review.
Again, Google will give you lots of good "beginning PHP" resources, and the PHP manual and other resources at php.net are also excellent.
I'm happy to help you with a specific question, but you need to understand a little bit more about the process before that will be of much help. Don't get discouraged, or in too big a hurry; what you take the time to learn now will be very valuable to you later.