Visualforce pages use the same expression language as formulas—that is, anything inside {! } is evaluated as an expression that can access values from records that are currently in context. For example, you can display the current user's first name by adding the {!$User.FirstName} expression to a page:
<apex:page> Hello {!$User.FirstName}! </apex:page>
$User is a global variable that always represents the current user record. All global variables are referenced with a $ symbol. For a list of global variables that you can use in Visualforce, see Global Variables.
To access fields from a record that is not globally available, like a specific account, contact, or custom object record, you need to associate your page with a controller. Controllers provide pages with the data and business logic that make your application run, including the logic that specifies how to access a particular object's records. While you can define a custom controller for any page with Apex, Salesforce includes standard controllers for every standard and custom object.
For example, to use the standard controller for accounts, add the standardController attribute to the <apex:page> tag, and assign it the name of the account object:
<apex:page standardController="Account"> Hello {!$User.FirstName}! </apex:page>
After you save your page, the Accounts tab is highlighted for the page, and the look-and-feel for the components on the page match the Accounts tab. Additionally, you can now access fields on the account record currently in context by using {!account.<fieldName>} expression syntax.
For example, to display an account's name on a page, use {!account.name} in the page markup:
<apex:page standardController="Account"> Hello {!$User.FirstName}! <p>You are viewing the {!account.name} account.</p> </apex:page>
https://na3.salesforce.com/001D000000IRt53
Then 001D000000IRt53 is the ID for the account.
https://na3.salesforce.com/apex/HelloWorld2
Add ?id=001D000000IRt53 to the end of the URL:
https://Salesforce_instance/apex/HelloWorld2?id=001D000000IRt53
Once an account ID is specified in the URL, the page displays the appropriate account name, as shown in the following figure.