Escape your HTML double quotation marks with a backslash,as in the following:
Use single quotation marks around your html.This can help improve the readability of your code if you have many quotes:
Remember that you have still to follow's rules:Follow the PHP guidelines and end your sentences with a semicolon,as well as close all quotes.
Don't try cram too much HTML into your PHP:
Php was really needed for was to provided the value represented by $_POST['fname'] and display it on the screen.The rest of the related code was just to output HTML.In this case ,You're better off just staying in HTML and pulling out the PHP line when you need it.