Both are usually diagnosed with a urinalysis, and determination of UTI versus kidney infection is then based on patient's symptoms (back/flank pain, vomiting, fevers usually indicate kidney involvement).
The antibiotic course for a kidney infection is longer than a simple UTI, but taking...