SiteMinder / Webhosting
The Computer Merchant, Ltd
US-MA-North Quincy

Justtechjobs.com Post A Job | Post A Resume

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 FixJayee08/09/08 17:01
Security "ouch!" at the form part...Dave10/04/07 09:20
Code FixJason10/30/05 15:36
php scriptolipa03/30/05 05:04
one detailIsrael Dominguez01/28/05 15:11
PHP Best PracticesJeroen10/16/04 04:32
RE: php codePests06/22/04 14:01
Small problemLonnie Olson06/02/04 19:03
Interesting but where are all the files?Henrik06/02/04 12:47
php codeSimon06/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.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.