Fixing your broken iPhone is very difficult and in most cases, can save you quite a bit of money. Most iphone screen repairs are caused by accidental damage, which isn’t covered under the Apple warranty. If your screen cracks due to the manufacturing defect, it’s covered by the Apple warranty and consumer law. If your iPhone's screen isn't working or responding to the touch but doesn't seem to be physically broken, try How to fix a stuck or frozen iPhone screen that's not working.
Check for warranty
If your iphone want to repair please check for the following, if it is out of warranty, whether it has 1st year manufacturers warranty, is it covered by AppleCare . If it is out of warranty, replace it on the Apple store. If you’re under the manufacturer’s warranty, you have to pay the same replacement cost as being out of warranty. If you have AppleCare . You payed $99 with your iphone and can get a replacement at an Apple Store or through AppleCare for $50-80, depending on the device.
Backup your files
To backup to iTunes, plug in the iOS device to a PC or Mac with iTunes installed and press “Backup” on the device summary screen. To backup to iCloud, go to Settings > iCloud > Storage and Backup (iOS 7) or Backup(iOS 8) and press to “Backup Now“. If you don’t have enough storage, you can always buy more iCloud storage.
How to fix if it is broken
Depending on your iphone model, this can either be remarkably easy or a bit of a drag. The iPhone 5 made it a lot easier to replace the display assembly but replacement parts are very expensive at over $200 at least for the front construction. You cannot replace only the glass but you must replace the whole construction: glass, digitiser and LCD included. Some scam-artists on eBay will try to sell just one of these items, but it is ultimately useless as the parts should be fused together.