How do toy websites carry a full line of toys that are older, unopened, and the manufacturer no longer sells?
How is it possible for people to have a website that sells action figures and other toys to carry a full line of old ones too? If the manufacturer (such as Hasbro) stopped making them years ago, where are the companies getting the stock?

It depends on the site, but many literally buy cases of a particular line of toys direct from the manufacturer. Usually these are sold off to consumers either as individual figures, a full set of a particular series, or by case. It’s interesting to note that since many collectors may be after a particular rare short-packed or chase figure, sites may force them into buying a whole set to get that one figure.
In any case, any left over product is still there in the inventory until the company sells it off, no matter how old it is. Sometimes this is a cheaper way to find old toys than trying to track them down on eBay.
Entertainment Earth is a site I check into from time to time.
It’s very current, but does carry some older stock.
http://rds.yahoo.com/_ylt=A0geu96nrAVHTU4A6UlXNyoA;_ylu=X3oDMTExbTV0dDR1BHNlYwNzcgRwb3MDMQRjb2xvA2FjMgR2dGlkAwRsA1dTMQ–/SIG=11mtosrul/EXP=1191640615/**http%3a//www.entertainmentearth.com/