if it is an iPhone running with the iOS 3.x, you can just insert wrong setting for the cellular network. Navigate in Setting/General/Network/Cellular Data Network,you should find three fields that normally are empty, just insert a letter on them. The iPhone won't be able to access internet through the cellular network. The only downside is that everytime you connect the iPhone to iTunes an alert message will appear saying that an update for you carrier setting is available, just disregard it. If one day you'll need to use the cellular network for internet, just clear the above fields.