Built in flash still popping up on my nikon d3100 even if an external flash in?

Ok I got the Neewer tt560 flash for my camera. It was said to work with it find. But when I have it on Program it will flash, but the camera doesn't know it i guess cause it still puts it on a 2 to 3 second shutter speed. And then if I put it on portrait mode, the built in flash pops up. Also the flash works in M mode. But won't work in S1 or S2 mode. Is it broke? Or what? Others said it worked freat with the d3100. But I don't get it. It's not syncing with the camera I guess? If it will work, how do i get it to sync?
Added (1). What flash will work then? Other than the Nikon ones? I don't have the money to get something that cost that much.

I would say it's not the flash or the camera but you. If you're running the camera on full auto that could be the problem. Get off full auto.

There are scene or automatic modes in which the camera will automatically pop-up its flash. However, with a TTL-compatible flash like the Nikon SB models installed and turned on, the camera should know its there and leave the built-in flash down. If the external flash is not TTL-compatible the camera behaves as if it is not there, although it can make it flash in manual mode.

It sounds like that isn't a ttl flash…
You'll have to use the manual exposure setting (M) on your 5100.
When using the flash, you can use any shutter speed 1/200 of a sec or slower.
- Nikon D7000 built in Flash pops with External Flash?
- Can i use external flash if my nikon d5000 built-in flash not working?
- My built in flash pops up, even though my speed light is connected?
- Nikon d3000 Internal Flash not popping open?
- Can the Nikon SB600 flash be triggered with the built-in flash of Nikon D3000?