When I went a couple of years ago I stayed at the Holiday Inn on Market Street in SF. It was mid-range price. Very nice hotel, however it's not in the thick of things from the point of view of being away from Pier 39/Fishermans Wharf etc (Which are all pretty pricey). However, it was just round the corner from the Interstate that comes from the airport which was a blessing - not having to drive thru traffic after a long flight, and the Market area was considered at the time an upcoming area with regards to bars and restaurants, so it may well be even better now. It's 10 minutes walking distance to one of the Cable cars, Union Square etc. and it's on a corner of Market and ummmm, can't remember the other street, but it leads pretty much straight to the water front. There are buses on both streets to take you about the city when you are ready to do the tourist trek. Though at night, the area was described as 'colourful' in the Virgin brochure. I can see it might make some people feel uncomfortable as there are a number of homeless people around there - they do ask for money, but all that we met we very polite and non-confrontational about it, however I didn't think it any worse than walking around Soho in London.
When I stayed in Anaheim, I did it <i>really</i> budget. It was called the Carousel Inn and is on the road directly opposite the park - we could see the monorail running and the tip of the Matterhorn from outside our door. It was more motel, than hotel though if you know what I mean. The door to the room was outside and easily accessible to the outside world, not inside a corridor, if you know what I mean. It did still feel pretty safe though and just a couple of minutes walk down the road there were a good few shops and restaurants (where I first discovered Tony Roma's) so driving isn't essential if you feel like a night off.
This, however was about 5-6 years ago though.