Jump to content
xisto Community

tjmcsax

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. so my code is <html><? setlocale(LC_TIME, "C"); $tod = strftime ("%H%M"); if ($tod > 500 && $tod <= 1159) {?> <style> Body { background: yellow; color: blue; font-weight: bold; } a { color:lightgreen; } a:active { color:white; } ul { color:lightgreen; } div#banner { background-color: lightblue; border-bottom: 1 px solid white; } div#banner h1 { margin:0; padding: .3em 0 .3em .5em; font-size: 2.2em; } div#navigation { float:left; width:200px; padding-left: 1em; padding-top: 2em; padding-bottom: 1em; background-color: green; } div#content { color: red; margin-left: 225; margin-top: 15; font-size: 1em; } div#content h1 { font-size: 2em; } </style><? } if ($tod > 1159 && $tod <= 1900) {?> <style> Body { background: blue; color: #00FFFF; font-weight: bold; } a, ul { color:#FFFF3D; } a:active { color:blue; } div#banner { background-color: 000033; border-bottom: 1 px solid white; } div#banner h1 { margin:0; padding: .3em 0 .3em .5em; font-size: 2.2em; } div#navigation { float:left; width:200px; padding-left: 1em; padding-top: 2em; padding-bottom: 1em; background-color: #0080FF; } div#content { color: white; margin-left: 225; margin-top: 15; font-size: 1em; } div#content h1 { font-size: 2em; } </style><? } if ($tod > 1900 || $tod <= 500) {?> <style> Body { background-color: 0000000; font-weight: bold; } a { color:FF0000; } a:active { color:white; } ul { color:FF0000; } div#banner { color: FF9900; background-color: FF3300; border-bottom: 1 px solid white; } div#banner h1 { margin:0; padding: .3em 0 .3em .5em; font-size: 2.2em; } div#navigation { float:left; width:200px; padding-left: 1em; padding-top: 2em; padding-bottom: 1em; background-color: yellow; } div#content { color: red; margin-left: 225; margin-top: 15; font-size: 1em; } div#content h1 { font-size: 2em; } </style><? }?><body><div id = "banner"><h1>Timed Site Colors</h1></div><div id = "navigation">Navagation Bar<br><br><ul> <li><a href="tod.txt">Site Source Code</a></li> <li><a href="~klee1/PHP">PHP</a></li></ul></div><div id = "content"><h1>About This Site</h1><br>This site uses PHP to determine the time of day, and when it reaches a certain point of day it will change color scheme. The code for this site found off of the navigation bar.<br></div></body></html> I was wondering if there was a way that I could keep the size of the php script down so that it doesn't take up as much space as it does. Is there a cleaner way to write this?
  2. Can you please explain the php code to me? I don't understand the $query = "INSERT INTO guestdb.Guests ( Name, Email ) VALUES ( " $query .= " '$_POST['Name']' , '$_POST ['Email']' )"; I understand what it does, but I don't really understand what variable is what. I also don't understand some of the commands. Sorry to be a bother, but I'm stupid.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.