Jump to content

Need Help! Just check this code ? :)


turtle

Recommended Posts

Hey guys... I'm learning PHP, i know html and css.. though its been a LONG time from the last time i used it... So if you can can you look at this:Notes:What im trying to do, is have it show how many files i have listed in each string.. which php adds... in the Upper Right Hand Corner.... basically this: "History = $fhis Math = $fmath Science = $fsci English = $feng Computer= $fcomp" So if you guys know a way to make a cool looking box in the upper-right hand corner, please give me the code!!!!Thanks.....

<html><head><title>Files</title></head><body><style type="text/css">div.files{border:2px double gray;right: 5px;vertical-align:top;}table.files {border:3px double blue;right: 10px;vertical-align:top;height:70px;width:100px;}</style><?php$his = "<h1>";$ehis = "</h1>";$math = "<h2>";$emath = "</h2>";$sci = "<h3>";$esci = "</h3>";$eng = "<h4>";$eeng = "</h4>";$comp = "<h5>";$ecomp = "<h6>";$fhis = 0;$fmath = 0;$fsci = 0;$feng = 2;$fcomp = 0;$total = $fhis + $fmath + $fsci + $feng + $fcomp;echo "There are $total files stored in our records";?><div id=files><table id="files"><tr><td><?php echo "History = $fhis Math = $fmath Science = $fsci English = $feng Computer= $fcomp"; ?>   </td></tr></table></div></body></html>

Link to comment
Share on other sites

Why dont you try compiling the code?

Link to comment
Share on other sites

BTW:

<html><head><title>Files</title></head><body><style type="text/css">div.files{border:2px double gray;right: 5px;vertical-align:top;}table.files {border:3px double blue;right: 10px;vertical-align:top;height:70px;width:100px;}</style><?php$his = "<h1>";$ehis = "</h1>";$math = "<h2>";$emath = "</h2>";$sci = "<h3>";$esci = "</h3>";$eng = "<h4>";$eeng = "</h4>";$comp = "<h5>";$ecomp = "<h6>";$fhis = 0;$fmath = 0;$fsci = 0;$feng = 2;$fcomp = 0;$total = $fhis + $fmath + $fsci + $feng + $fcomp;echo "There are ".$total." files stored in our records";?><div id=files><table id="files"><tr><td><?php echo "History = ."$fhis." Math = ".$fmath." Science = ".$fsci". English = ".$feng." Computer= ."$fcomp"; ?>   </td></tr></table></div></body></html>

Close the string and add a '.' to add a string inside a variable.E.G: echo "Hello".$some_var_containing_world;

Link to comment
Share on other sites

Actually sniffy, you only need to do that for functions. So his is fine right now. No need for extra work! But whats happening right now? Any error or anything, if you just want it to look nice then you will need to either make it yourself or fine some code that you think looks nice.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...