|
Comments for: timlin20040528
| Message # 1510728: |
|
Date: 08/09/08 17:01
By: Jayee Subject: RE: Code Fix I am trying to create a code that determines if a year is a leap year. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Leap Year</title> </head> <body> <?php $date = $_GET["date"]; for ($date /4) || $date /400 && $date /100) { $d = $date % $count if $d == 0; { $count = $date; } } if ($d !=0) { echo "<p>$date is a standard year.</p>"; } else { echo "<p>$date is a leap year.</p>"; } ?> </body> </html> For this code, I am trying to determine if 3 segments entered by the user will form a triangle. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Triangle</title> </head> <body> <?php $seg1 = $_GET["segment1"]; $seg2 = $_GET["segment2"]; $seg3 = $_GET["segment3"]; if (($seg1 + $seg2) > $seg3) echo "<p> This is a triangle. </p>"; else { if (($seg1 + $seg3) > $seg2) echo "<p> This is a triangle. <p>"; else { if (($seg2 + $seg3) > $seg1) echo "<p> This is a triangle. <p>"; else { echo "<p> This is not a triangle. <p>"; } } } ?> </body> </html> |
Previous Message | Next Message |
| Comments: | ||
| RE: Code Fix | Jayee | 08/09/08 17:01 |
| Security "ouch!" at the form part... | Dave | 10/04/07 09:20 |
| Code Fix | Jason | 10/30/05 15:36 |
| php script | olipa | 03/30/05 05:04 |
| one detail | Israel Dominguez | 01/28/05 15:11 |
| PHP Best Practices | Jeroen | 10/16/04 04:32 |
| RE: php code | Pests | 06/22/04 14:01 |
| Small problem | Lonnie Olson | 06/02/04 19:03 |
| Interesting but where are all the files? | Henrik | 06/02/04 12:47 |
| php code | Simon | 06/02/04 02:44 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


