There are a number of resources and review sites for booking short term accommodation in Shanghai. It is advised that you stay not too far from a subway station: People's Square, the former French Concession and Jing'an are all centrally-located and packed with enough local action to be ideal locations for short stays.
Hotels come in all shapes, sizes and prices and it is recommended that you read relevant review sites or post in /r/shanghai for particular recommendations.
For boutique semi-luxury hotels, try:
Shanghai has a number of franchised motels offering very basic clean rooms with washroom facilities for around 200 RMB. Brands such as Motel 168, Hanting Inn, and 7 Days Inn are well-organised, no nonsense and affordable.
HostelsEditThere are many Shanghai hostels listed on popular hostel listing sites like Hostel World and HostelBookers. Two particular recommendations are:
For a comprehensive discussion of low-cost accommodation in Shanghai (up-to-date as of September 2013), please check out this thread on /r/shanghai.
This recent phenomenon sees private households lease out part or all of an apartment to tourists and guests. Visitors are literally staying the night in someone's home, and the experience is regarded as more intimate than a hotel. All bookings, payments and the self-monitoring feedback system are managed through the airBnb website and you can find listings for Shanghai here.
Popular crowdsourced accommodation site couchsurfing.org has over 10,000 listings for Shanghai. While such an untraditional method of accommodation can be an unpredictable experience, nevertheless it remains a cheap and potentially rewarding option for backpackers.