A company that puts its stock up for sale through an IPO will not benefit from a rising share price on shares they've already sold to the market. To understand why, keep in mind that the stock market is actually comprised of two markets—a primary market and a secondary market.
In the primary market, a company issues shares to investors who remit capital to the company for the shares. It is only at this time that the company receives capital for their shares (this is the process of equity financing). Once the shares are issued at the specified offering price, the company receives their cash.
In the secondary market, investors who originally bought the issue in the primary market sell their shares to other investors, who in turn hold their shares and eventually sell them to other investors as well. It is this secondary market that is actively followed by the media and produces the daily price changes in stocks.
Because the secondary market only involves investors buying and selling securities from other investors, public companies themselves do not see direct profits or losses from price changes.
However, it is still advantageous for a public company to have a strong share price because it increases the company's market capitalization and thus its ability to issue more equity shares at relatively high offering prices (effectively allowing it to raise equity capital cheaply).