You can do AirBnB legally if a resident is still in the apartment while you're there (so you'd be renting a room rather than the entire apartment; and sometimes you'll get a room and your own bathroom). The city government did announce that they were putting $10 million into cracking down on "illegal hotels" (read: AirBnB) but I haven't heard much about people getting caught (and as the author of Frommer's EasyGuide to New York City I've followed this issue carefully). I also recommend a few places on this site that are usually affordable and in Manhattan. If I were you I'd look at the Hotel Newton, the Hotel Deauville and Le Belleclaire. All will have private bathrooms in the rooms, are well located (in Manhattan) and are usually well-priced (you never know in NYC as prices can really ping pong). Or, as the Billi suggested: you may want to look in Queens (specifically Long Island City, which is only a few subway stops from Manhattan). I have some recommended places there too, which you'll also see on this site. And yes, I've visited them ALL (so can compare one of the next as I hope you'll see in the reviews).
The other strategy: make a reservation, so that you know you'll have a room. And then two days before you arrive make a bid on Priceline.com or Hotwire.com. They only work with chain hotels, so you pretty much know what you're getting. And sometimes by going after last-minute deals, you can get the best prices. Just make sure that the hotel you make the initial reservation at will allow you to cancel within 48 hours without penalty.