Change text color when invalid CAPTCHA

0
August 15, 2011

Hello guys,

I have just implemented a CAPTCHA routine (with help from the experts here) and want to manage the invalid CAPTCH by changing the text color of the following: "Please enter the code appearing in the following picture" as shown in the code snipet.

Rgds,

Etienne

<?php
// START THE SESSION EVERY TIME
error_reporting(E_ALL);
session_start();

// TEST FOR THE CAPTCHA
if(isset($_POST["captcha"]))
{if($_SESSION["captcha"]==$_POST["captcha"]){    require_once("ProcessMail.php");}else{    echo 'CAPTCHA is not valid; Please try adgain';        // VISUALIZE THE SUPERGLOBAL ARRAYS echo "<pre>";   echo "POST: ";var_dump($_POST);   echo "\n\n\n";    echo "SESSION: ";var_dump($_SESSION);}

    // NO FURTHER PROCESSINGdie();
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<head>
<title>Oceanlogics :: Contact Us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
        background-color: #1A6173;
        text-align: center;
}
.oneColFixCtr #container {
        width: 750px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
        background: #1A6173;
        margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
        text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColFixCtr #mainContent {
        padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
}
.style3 {
        font-family: Georgia, "Times New Roman", Times, serif;
        font-size: 12px;
        color: #1A6173;
        font-weight: bold;
}
.style4 {font-size: 18px}
.style6 {font-size: 24px}
.style7 {font-family: Georgia, "Times New Roman", Times, serif;margin-left: 3px;margin-top: 3px;font-size: 10px;color: #1A6173;
}
-->

</style></head>

<body class="oneColFixCtr">

<div id="container">
  <div id="mainContent">
    <table border=0 cellspacing=0 cellpadding=0 width=750 height=650>
<tr>
<td><img border=0 src="Images/header_top.jpg" height=147 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=21>
<tr>
<td><img border=0 src="Images/spacer_1.jpg" height=21 width=11></td>
<td><a href="Home.html"><img border=0 src="Images/nav_home.jpg" height=21 width=95 onMouseOver="this.src = 'Images/nav_home_hot.jpg' " onMouseOut="this.src = 'Images/nav_home.jpg' "></a></td>
<td><img border=0 src="Images/spacer_2.jpg" height=21 width=10></td>
<td><img border=0 src="Images/nav_services.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_services_hot.jpg' " onMouseOut="this.src = 'Images/nav_services.jpg' "></td>
<td><img border=0 src="Images/spacer_3.jpg" height=21 width=9></td>
<td><img border=0 src="Images/nav_products.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_products_hot.jpg' " onMouseOut="this.src = 'Images/nav_products.jpg' "></td>
<td><img border=0 src="Images/spacer_4.jpg" height=21 width=10></td>
<td><img border=0 src="Images/nav_downloads.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_downloads_hot.jpg' " onMouseOut="this.src = 'Images/nav_downloads.jpg' "></td>
<td><img border=0 src="Images/spacer_5.jpg" height=21 width=9></td>
<td><a href="phpBB2/index.php"><img border=0 src="Images/nav_forum.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_forum_hot.jpg' " onMouseOut="this.src = 'Images/nav_forum.jpg' "></a></td>
<td><img border=0 src="Images/spacer_6.jpg" height=21 width=9></td>
<td><img border=0 src="Images/nav_news.jpg" height=21 width=97 onMouseOver="this.src = 'Images/nav_news_hot.jpg' " onMouseOut="this.src = 'Images/nav_news.jpg' "></td>
<td><img border=0 src="Images/spacer_7.jpg" height=21 width=9></td>
<td><a href="Contact.html"><img border=0 src="Images/nav_contact_us_hot.jpg" height=21 width=95></a></td>

<td><img border=0 src="Images/spacer_8.jpg" height=21 width=12></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/header_bottom.jpg" height=27 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=386>
<tr>
<td><img border=0 src="Images/border_left.jpg" height=386 width=20></td>
<td><table border=0 cellspacing=0 cellpadding=0 width=200 height=386>
<tr>
<td background="Images/body_div_1.jpg" height=25 width=200><span class="style3">Name</span></td>
</tr><tr>
<td background="Images/body_div_2.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Name" type="text" class="form m_text" id="Name" size="28" />
</span></td>
</tr><tr>
<td background="Images/body_div3.jpg" height=25 width=200><span class="style3">Company</span></td>
</tr><tr>
<td background="Images/body_div_4.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Company" type="text" class="form m_text" id="Company" size="28" />
</span></td>
</tr><tr>
<td background="Images/body_div_5.jpg" height=25 width=200><span class="style3">Phone</span></td>
</tr><tr>
<td background="Images/body_div_6.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Phone" type="text" class="form m_text" id="Phone" size="28" />
</span></td>
</tr><tr>
<td background="Images/body_div_7.jpg" height=25 width=200><span class="style3">Email</span></td>
</tr><tr>
<td background="Images/body_div_8.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Email" type="text" class="form m_text" id="Email" size="28" />
</span></td>
</tr><tr>
<td width=200 height=136 valign="bottom" background="Images/body_div_9.jpg"><p align="left" class="style3 style4"><span class="style6">Oceanlogics Inc</span><Br>
  1141 des Trilles<Br>
  Prevost, Quebec<Br>
   Canada J0R 1T0<Br>
</td>
</tr><tr>
<td background="Images/body_div_10.jpg" height=25 width=200><span class="style3">P/F: +001 (450) 669-8859</span></td>
</tr><tr>
<td background="Images/body_div_11.jpg" height=25 width=200> </td>
</tr>
</table></td>
<td><table border=0 cellspacing=0 cellpadding=0 width=510 height=386>
<tr>
<td background="Images/body_div_12.jpg" height=25 width=510><div align="right"><span class="style3" style="margin-top0:px;">Subject</span></div></td>
</tr><tr>
<td background="Images/body_div_13.jpg" height=25 width=510><div align="right"><span class="form_div" style="margin-top0:px;">
  <input name="Subject" type="text" class="form m_text" id="Subject" size="77" />
</span></div></td>
</tr><tr>
<td width=510 height=25 background="Images/body_div_14.jpg" class="style3"><div align="right">Message</div></td>
</tr><tr>
<td width=510 height=286 valign="top" background="Images/body_div_15.jpg"><div align="right"><span style="margin-top:0px">
  <textarea name="Message" cols="60" rows="10" class="form m_text" id="Message" style="height:260px; overflow:hidden"></textarea>
</span></div></td>
</tr><tr>
<td width=510 height=25 valign="bottom" background="Images/body_div_16.jpg"><div align="right" class="oneColFixCtr">
  <span style="margin-left:3px; margin-top:3px;"><span class="style7">Please enter the code appearing in the following picture</span><span style="margin-left:3px; margin-top:3px;"> <img src="Captcha.php" alt="captcha image" height="20" /></span></span><span class="_text" style="margin-left:3px; margin-top:3px;"><span class="_text" style="margin-left:3px; margin-top:3px;">
  <input type="text" name="captcha" size="6" maxlength="6">
  </span>
  <input type="submit" value="Submit">
  </span></div></td>
</tr>
</table></td>
<td><img border=0 src="Images/border_right.jpg" height=386 width=20></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/footer_top.jpg" height=47 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=11>
<tr>
<td><img border=0 src="Images/spacer_9.jpg" height=11 width=51></td>
<td><img border=0 src="Images/nav_company.jpg" height=11 width=54></td>
<td><img border=0 src="Images/nav_support.jpg" height=11 width=50></td>
<td><img border=0 src="Images/nav_links.jpg" height=11 width=34></td>
<td><img border=0 src="Images/nav_upcoming_events.jpg" height=11 width=100></td>
<td><img border=0 src="Images/nav_faq.jpg" height=11 width=26></td>
<td><img border=0 src="Images/nav_our_clients.jpg" height=11 width=65></td>
<td><img border=0 src="Images/nav_pictures.jpg" height=11 width=52></td>
<td><img border=0 src="Images/nav_intranet.jpg" height=11 width=50></td>
<td><img border=0 src="Images/nav_webmail.jpg" height=11 width=53></td>
<td><img border=0 src="Images/nav_site_map.jpg" height=11 width=56></td>
<td><a href="Terms.html"><img border=0 src="Images/nav_terms_and_conditions.jpg" height=11 width=116></a></td>
<td><img border=0 src="Images/spacer_10.jpg" height=11 width=43></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/footer_bottom.jpg" height=11 width=750></td>
</tr>
</table>
  <!-- end #mainContent --></div>
</div>

</body>

Comments See all(0)

Add comment
0
August 15, 2011

Try this code

<?php
// START THE SESSION EVERY TIME
error_reporting(E_ALL);
session_start();
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<head>
<title>Oceanlogics :: Contact Us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
        background-color: #1A6173;
        text-align: center;
}
.oneColFixCtr #container {
        width: 750px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
        background: #1A6173;
        margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
        text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColFixCtr #mainContent {
        padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
}
.style3 {
        font-family: Georgia, "Times New Roman", Times, serif;
        font-size: 12px;
        color: #1A6173;
        font-weight: bold;
}
.style4 {font-size: 18px}
.style6 {font-size: 24px}
<?php
if(isset($_POST["captcha"]) && $_SESSION["captcha"]!=$_POST["captcha"])
{
?>
.style7 {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 3px;
        margin-top: 3px;
        font-size: 10px;
        color: red
}
<?php
}
else
{
?>
.style7 {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 3px;
        margin-top: 3px;
        font-size: 10px;
        color: #1A6173;
}
<?php
}
?>
-->

</style></head>

<body class="oneColFixCtr">

<div id="container">
  <div id="mainContent">
    <table border=0 cellspacing=0 cellpadding=0 width=750 height=650>
<tr>
<td><img border=0 src="Images/header_top.jpg" height=147 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=21>
<tr>
<td><img border=0 src="Images/spacer_1.jpg" height=21 width=11></td>
<td><a href="Home.html"><img border=0 src="Images/nav_home.jpg" height=21 width=95 onMouseOver="this.src = 'Images/nav_home_hot.jpg' " onMouseOut="this.src = 'Images/nav_home.jpg' "></a></td>
<td><img border=0 src="Images/spacer_2.jpg" height=21 width=10></td>
<td><img border=0 src="Images/nav_services.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_services_hot.jpg' " onMouseOut="this.src = 'Images/nav_services.jpg' "></td>
<td><img border=0 src="Images/spacer_3.jpg" height=21 width=9></td>
<td><img border=0 src="Images/nav_products.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_products_hot.jpg' " onMouseOut="this.src = 'Images/nav_products.jpg' "></td>
<td><img border=0 src="Images/spacer_4.jpg" height=21 width=10></td>
<td><img border=0 src="Images/nav_downloads.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_downloads_hot.jpg' " onMouseOut="this.src = 'Images/nav_downloads.jpg' "></td>
<td><img border=0 src="Images/spacer_5.jpg" height=21 width=9></td>
<td><a href="phpBB2/index.php"><img border=0 src="Images/nav_forum.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_forum_hot.jpg' " onMouseOut="this.src = 'Images/nav_forum.jpg' "></a></td>
<td><img border=0 src="Images/spacer_6.jpg" height=21 width=9></td>
<td><img border=0 src="Images/nav_news.jpg" height=21 width=97 onMouseOver="this.src = 'Images/nav_news_hot.jpg' " onMouseOut="this.src = 'Images/nav_news.jpg' "></td>
<td><img border=0 src="Images/spacer_7.jpg" height=21 width=9></td>
<td><a href="Contact.html"><img border=0 src="Images/nav_contact_us_hot.jpg" height=21 width=95></a></td>

<td><img border=0 src="Images/spacer_8.jpg" height=21 width=12></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/header_bottom.jpg" height=27 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=386>
<tr>
<td><img border=0 src="Images/border_left.jpg" height=386 width=20></td>
<td><table border=0 cellspacing=0 cellpadding=0 width=200 height=386>
<tr>
<td background="Images/body_div_1.jpg" height=25 width=200><span class="style3">Name</span></td>
</tr><tr>
<td background="Images/body_div_2.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Name" type="text" class="form m_text" id="Name" size="28" />
</span></td>
</tr><tr>
<td background="Images/body_div3.jpg" height=25 width=200><span class="style3">Company</span></td>
</tr><tr>
<td background="Images/body_div_4.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Company" type="text" class="form m_text" id="Company" size="28" />
</span></td>
</tr><tr>
<td background="Images/body_div_5.jpg" height=25 width=200><span class="style3">Phone</span></td>
</tr><tr>
<td background="Images/body_div_6.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Phone" type="text" class="form m_text" id="Phone" size="28" />
</span></td>
</tr><tr>
<td background="Images/body_div_7.jpg" height=25 width=200><span class="style3">Email</span></td>
</tr><tr>
<td background="Images/body_div_8.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Email" type="text" class="form m_text" id="Email" size="28" />
</span></td>
</tr><tr>
<td width=200 height=136 valign="bottom" background="Images/body_div_9.jpg"><p align="left" class="style3 style4"><span class="style6">Oceanlogics Inc</span><Br>
  1141 des Trilles<Br>
  Prevost, Quebec<Br>
   Canada J0R 1T0<Br>
</td>
</tr><tr>
<td background="Images/body_div_10.jpg" height=25 width=200><span class="style3">P/F: +001 (450) 669-8859</span></td>
</tr><tr>
<td background="Images/body_div_11.jpg" height=25 width=200> </td>
</tr>
</table></td>
<td><table border=0 cellspacing=0 cellpadding=0 width=510 height=386>
<tr>
<td background="Images/body_div_12.jpg" height=25 width=510><div align="right"><span class="style3" style="margin-top0:px;">Subject</span></div></td>
</tr><tr>
<td background="Images/body_div_13.jpg" height=25 width=510><div align="right"><span class="form_div" style="margin-top0:px;">
  <input name="Subject" type="text" class="form m_text" id="Subject" size="77" />
</span></div></td>
</tr><tr>
<td width=510 height=25 background="Images/body_div_14.jpg" class="style3"><div align="right">Message</div></td>
</tr><tr>
<td width=510 height=286 valign="top" background="Images/body_div_15.jpg"><div align="right"><span style="margin-top:0px">
  <textarea name="Message" cols="60" rows="10" class="form m_text" id="Message" style="height:260px; overflow:hidden"></textarea>
</span></div></td>
</tr><tr>
<td width=510 height=25 valign="bottom" background="Images/body_div_16.jpg"><div align="right" class="oneColFixCtr">
  <span style="margin-left:3px; margin-top:3px;"><span class="style7">Please enter the code appearing in the following picture</span><span style="margin-left:3px; margin-top:3px;"> <img src="Captcha.php" alt="captcha image" height="20" /></span></span><span class="_text" style="margin-left:3px; margin-top:3px;"><span class="_text" style="margin-left:3px; margin-top:3px;">
  <input type="text" name="captcha" size="6" maxlength="6">
  </span>
  <input type="submit" value="Submit">
  </span></div></td>
</tr>
</table></td>
<td><img border=0 src="Images/border_right.jpg" height=386 width=20></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/footer_top.jpg" height=47 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=11>
<tr>
<td><img border=0 src="Images/spacer_9.jpg" height=11 width=51></td>
<td><img border=0 src="Images/nav_company.jpg" height=11 width=54></td>
<td><img border=0 src="Images/nav_support.jpg" height=11 width=50></td>
<td><img border=0 src="Images/nav_links.jpg" height=11 width=34></td>
<td><img border=0 src="Images/nav_upcoming_events.jpg" height=11 width=100></td>
<td><img border=0 src="Images/nav_faq.jpg" height=11 width=26></td>
<td><img border=0 src="Images/nav_our_clients.jpg" height=11 width=65></td>
<td><img border=0 src="Images/nav_pictures.jpg" height=11 width=52></td>
<td><img border=0 src="Images/nav_intranet.jpg" height=11 width=50></td>
<td><img border=0 src="Images/nav_webmail.jpg" height=11 width=53></td>
<td><img border=0 src="Images/nav_site_map.jpg" height=11 width=56></td>
<td><a href="Terms.html"><img border=0 src="Images/nav_terms_and_conditions.jpg" height=11 width=116></a></td>
<td><img border=0 src="Images/spacer_10.jpg" height=11 width=43></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/footer_bottom.jpg" height=11 width=750></td>
</tr>
</table>
  <!-- end #mainContent --></div>
</div>

</body>
0
August 15, 2011

you can either change the color in the span7 or change the color for this span alone

chaange the color of style7

<span class="style7">Please enter the code appearing in the following picture</span>

OR

<span class="style7" style="color:red;">Please enter the code appearing in the following picture</span>
0
August 15, 2011

Thanks,

I am actually looking for the exact code to replace line 15 to 20 of my original code snippet.

Alternativelly, would it be possible to have the sumbit button disabled until the CAPTCHA is good?

0
August 15, 2011

Line 15-20 replacement. The submit button can be disabled but in this case it cannot be because the captcha check is done after posback so if you disable submit button they cannot postback

echo "<span style='color:red'>CAPTCHA is not valid; Please try adgain";
                        // VISUALIZE THE SUPERGLOBAL ARRAYS
                echo "<pre>";
                echo "POST: ";var_dump($_POST);
                echo "\n\n\n";
                echo "SESSION: ";var_dump($_SESSION);
echo "</span>"
0
August 15, 2011

I end up with this displayed in red in the browser when I want to keep the same page, just change the color of the text specified in the original question in order for the end-used to know he has entered invalid CAPTCHA or none.

CAPTCHA is not valid; Please try adgain

POST: array(7) {

  ["Name"]=>

  string(0) ""

  ["Company"]=>

  string(0) ""

  ["Phone"]=>

  string(0) ""

  ["Email"]=>

  string(0) ""

  ["Subject"]=>

  string(0) ""

  ["Message"]=>

  string(0) ""

  ["captcha"]=>

  string(0) ""

}

SESSION: array(1) {

  ["captcha"]=>

  string(6) "YjBM6b"

}

cheers

0
August 15, 2011

Then try it this way

echo "<span style='color:red'>CAPTCHA is not valid; Please try again</span>";
                        // VISUALIZE THE SUPERGLOBAL ARRAYS
                echo "<pre>";
                echo "POST: ";var_dump($_POST);
                echo "\n\n\n";
                echo "SESSION: ";var_dump($_SESSION);
0
August 15, 2011

OK the reason why my page was reseting was because I had die in line 24 of original snippet.

I might not have been clear.

I have the following line "Please enter the code appearing in the following picture" (line 154) whitch uses "style7" (line 57).

The goal, as you suggested, is to modify style7 color to red.

echo will not work as it puts text on the web page.

Do you any any other ideas?

Cheers

0
August 15, 2011

May be we are not on the same page yet. Can you explain what is the exact requirement?

0
August 15, 2011

OK

please follow this link:

http://www.oceanlogics.com /Contact.p hp

it will all come clear.

do not put anything in, just click submit.

There are no indications to the end user that the captcha is invalid.

I just want to change the color of the text beside the captcha to red.

0
August 15, 2011

Now i see what you need. My php skills are not very good but this is what you need to do

<?php
// START THE SESSION EVERY TIME
error_reporting(E_ALL);
session_start();
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<head>
<title>Oceanlogics :: Contact Us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
        background-color: #1A6173;
        text-align: center;
}
.oneColFixCtr #container {
        width: 750px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
        background: #1A6173;
        margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
        text-align: left; /* this overrides the text-align: center on the body element. */
}
.oneColFixCtr #mainContent {
        padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
}
.style3 {
        font-family: Georgia, "Times New Roman", Times, serif;
        font-size: 12px;
        color: #1A6173;
        font-weight: bold;
}
.style4 {font-size: 18px}
.style6 {font-size: 24px}
<?php
if(isset($_POST["captcha"]))
{
        if($_SESSION["captcha"]==$_POST["captcha"])
        {
?>
.style7 {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 3px;
        margin-top: 3px;
        font-size: 10px;
        color: #1A6173;
}
<?php
        }
        else
        {
?>
.style7 {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 3px;
        margin-top: 3px;
        font-size: 10px;
        color: red;
}
<?php
        }
else
{
?>
.style7 {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 3px;
        margin-top: 3px;
        font-size: 10px;
        color: #1A6173;
}
<?php
}
}
?>
-->

</style></head>

<body class="oneColFixCtr">

<div id="container">
  <div id="mainContent">
    <table border=0 cellspacing=0 cellpadding=0 width=750 height=650>
<tr>
<td><img border=0 src="Images/header_top.jpg" height=147 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=21>
<tr>
<td><img border=0 src="Images/spacer_1.jpg" height=21 width=11></td>
<td><a href="Home.html"><img border=0 src="Images/nav_home.jpg" height=21 width=95 onMouseOver="this.src = 'Images/nav_home_hot.jpg' " onMouseOut="this.src = 'Images/nav_home.jpg' "></a></td>
<td><img border=0 src="Images/spacer_2.jpg" height=21 width=10></td>
<td><img border=0 src="Images/nav_services.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_services_hot.jpg' " onMouseOut="this.src = 'Images/nav_services.jpg' "></td>
<td><img border=0 src="Images/spacer_3.jpg" height=21 width=9></td>
<td><img border=0 src="Images/nav_products.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_products_hot.jpg' " onMouseOut="this.src = 'Images/nav_products.jpg' "></td>
<td><img border=0 src="Images/spacer_4.jpg" height=21 width=10></td>
<td><img border=0 src="Images/nav_downloads.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_downloads_hot.jpg' " onMouseOut="this.src = 'Images/nav_downloads.jpg' "></td>
<td><img border=0 src="Images/spacer_5.jpg" height=21 width=9></td>
<td><a href="phpBB2/index.php"><img border=0 src="Images/nav_forum.jpg" height=21 width=96 onMouseOver="this.src = 'Images/nav_forum_hot.jpg' " onMouseOut="this.src = 'Images/nav_forum.jpg' "></a></td>
<td><img border=0 src="Images/spacer_6.jpg" height=21 width=9></td>
<td><img border=0 src="Images/nav_news.jpg" height=21 width=97 onMouseOver="this.src = 'Images/nav_news_hot.jpg' " onMouseOut="this.src = 'Images/nav_news.jpg' "></td>
<td><img border=0 src="Images/spacer_7.jpg" height=21 width=9></td>
<td><a href="Contact.html"><img border=0 src="Images/nav_contact_us_hot.jpg" height=21 width=95></a></td>

<td><img border=0 src="Images/spacer_8.jpg" height=21 width=12></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/header_bottom.jpg" height=27 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=386>
<tr>
<td><img border=0 src="Images/border_left.jpg" height=386 width=20></td>
<td><table border=0 cellspacing=0 cellpadding=0 width=200 height=386>
<tr>
<td background="Images/body_div_1.jpg" height=25 width=200><span class="style3">Name</span></td>
</tr><tr>
<td background="Images/body_div_2.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Name" type="text" class="form m_text" id="Name" size="28" />
</span></td>
</tr><tr>
<td background="Images/body_div3.jpg" height=25 width=200><span class="style3">Company</span></td>
</tr><tr>
<td background="Images/body_div_4.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Company" type="text" class="form m_text" id="Company" size="28" />
</span></td>
</tr><tr>
<td background="Images/body_div_5.jpg" height=25 width=200><span class="style3">Phone</span></td>
</tr><tr>
<td background="Images/body_div_6.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Phone" type="text" class="form m_text" id="Phone" size="28" />
</span></td>
</tr><tr>
<td background="Images/body_div_7.jpg" height=25 width=200><span class="style3">Email</span></td>
</tr><tr>
<td background="Images/body_div_8.jpg" height=25 width=200><span class="form_div" style="margin-top0:px;">
  <input name="Email" type="text" class="form m_text" id="Email" size="28" />
</span></td>
</tr><tr>
<td width=200 height=136 valign="bottom" background="Images/body_div_9.jpg"><p align="left" class="style3 style4"><span class="style6">Oceanlogics Inc</span><Br>
  1141 des Trilles<Br>
  Prevost, Quebec<Br>
   Canada J0R 1T0<Br>
</td>
</tr><tr>
<td background="Images/body_div_10.jpg" height=25 width=200><span class="style3">P/F: +001 (450) 669-8859</span></td>
</tr><tr>
<td background="Images/body_div_11.jpg" height=25 width=200> </td>
</tr>
</table></td>
<td><table border=0 cellspacing=0 cellpadding=0 width=510 height=386>
<tr>
<td background="Images/body_div_12.jpg" height=25 width=510><div align="right"><span class="style3" style="margin-top0:px;">Subject</span></div></td>
</tr><tr>
<td background="Images/body_div_13.jpg" height=25 width=510><div align="right"><span class="form_div" style="margin-top0:px;">
  <input name="Subject" type="text" class="form m_text" id="Subject" size="77" />
</span></div></td>
</tr><tr>
<td width=510 height=25 background="Images/body_div_14.jpg" class="style3"><div align="right">Message</div></td>
</tr><tr>
<td width=510 height=286 valign="top" background="Images/body_div_15.jpg"><div align="right"><span style="margin-top:0px">
  <textarea name="Message" cols="60" rows="10" class="form m_text" id="Message" style="height:260px; overflow:hidden"></textarea>
</span></div></td>
</tr><tr>
<td width=510 height=25 valign="bottom" background="Images/body_div_16.jpg"><div align="right" class="oneColFixCtr">
  <span style="margin-left:3px; margin-top:3px;"><span class="style7">Please enter the code appearing in the following picture</span><span style="margin-left:3px; margin-top:3px;"> <img src="Captcha.php" alt="captcha image" height="20" /></span></span><span class="_text" style="margin-left:3px; margin-top:3px;"><span class="_text" style="margin-left:3px; margin-top:3px;">
  <input type="text" name="captcha" size="6" maxlength="6">
  </span>
  <input type="submit" value="Submit">
  </span></div></td>
</tr>
</table></td>
<td><img border=0 src="Images/border_right.jpg" height=386 width=20></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/footer_top.jpg" height=47 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=11>
<tr>
<td><img border=0 src="Images/spacer_9.jpg" height=11 width=51></td>
<td><img border=0 src="Images/nav_company.jpg" height=11 width=54></td>
<td><img border=0 src="Images/nav_support.jpg" height=11 width=50></td>
<td><img border=0 src="Images/nav_links.jpg" height=11 width=34></td>
<td><img border=0 src="Images/nav_upcoming_events.jpg" height=11 width=100></td>
<td><img border=0 src="Images/nav_faq.jpg" height=11 width=26></td>
<td><img border=0 src="Images/nav_our_clients.jpg" height=11 width=65></td>
<td><img border=0 src="Images/nav_pictures.jpg" height=11 width=52></td>
<td><img border=0 src="Images/nav_intranet.jpg" height=11 width=50></td>
<td><img border=0 src="Images/nav_webmail.jpg" height=11 width=53></td>
<td><img border=0 src="Images/nav_site_map.jpg" height=11 width=56></td>
<td><a href="Terms.html"><img border=0 src="Images/nav_terms_and_conditions.jpg" height=11 width=116></a></td>
<td><img border=0 src="Images/spacer_10.jpg" height=11 width=43></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/footer_bottom.jpg" height=11 width=750></td>
</tr>
</table>
  <!-- end #mainContent --></div>
</div>

</body>
0
August 15, 2011

Or using a single condition

<?php
if(isset($_POST["captcha"]) && $_SESSION["captcha"]!=$_POST["captcha"])
{
?>
.style7 {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 3px;
        margin-top: 3px;
        font-size: 10px;
        color: red
}
<?php
}
else
{
?>
.style7 {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 3px;
        margin-top: 3px;
        font-size: 10px;
        color: #1A6173;
}
<?php
}
?>
0
August 15, 2011

unfortunatelly this doesn't wotk, eror msg

0
August 15, 2011

I might have missed some opening or closing tag but this is the way to do it. Please see if I have missed any php tags as I am not sure about PHP. I work on .NET

0
August 15, 2011

I had an extra closing braces in my 1st code i pasted may be that might have caused the problem

0
August 15, 2011

Many thanks its exactly what I wanted.

0
August 15, 2011

There was a little mistake in the solution where the valid captcha was not assigned.

see code snippet for final and complete solution.

(basically add line 5 to 8)

Cheers

<?php
// START THE SESSION EVERY TIME
error_reporting(E_ALL);
session_start();
if(isset($_POST["captcha"]) && $_SESSION["captcha"]==$_POST["captcha"])
{    require_once("ProcessMail.php");
}
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<head>
<title>Oceanlogics :: Contact Us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
    background-color: #006070;
    text-align: center;margin: 0;padding: 0;
}
.style3 {
        font-family: Georgia, "Times New Roman", Times, serif;
        font-size: 12px;
        color: #1A6173;
        font-weight: bold;
}
.style4 {font-size: 18px}
.style6 {font-size: 24px}
<?php
if(isset($_POST["captcha"]) && $_SESSION["captcha"]!=$_POST["captcha"])
{
?>
.style7 {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 3px;
        margin-top: 3px;
        font-size: 10px;
        color: red
}
<?php
}
else
{
?>
.style7 {
        font-family: Georgia, "Times New Roman", Times, serif;
        margin-left: 3px;
        margin-top: 3px;
        font-size: 10px;
        color: #1A6173;
}
<?php
}
?>


-->

</style></head>

<body>

<div id="mainContent">
    <table border=0 cellspacing=0 cellpadding=0 width=750 height=650>
<tr>
<td><img border=0 src="Images/header_top.jpg" height=147 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=21>
<tr>
<td><img border=0 src="Images/spacer_1.jpg" height=21 width=8></td>
<td><a href="Home.html"><img border=0 src="Images/nav_home.jpg" height=21 width=101 onMouseOver="this.src = 'Images/nav_home_hot.jpg' " onMouseOut="this.src = 'Images/nav_home.jpg' "></a></td>
<td><img border=0 src="Images/spacer_2.jpg" height=21 width=4></td>
<td><img border=0 src="Images/nav_services.jpg" height=21 width=100 onMouseOver="this.src = 'Images/nav_services_hot.jpg' " onMouseOut="this.src = 'Images/nav_services.jpg' "></td>
<td><img border=0 src="Images/spacer_3.jpg" height=21 width=5></td>
<td><img border=0 src="Images/nav_products.jpg" height=21 width=101 onMouseOver="this.src = 'Images/nav_products_hot.jpg' " onMouseOut="this.src = 'Images/nav_products.jpg' "></td>
<td><img border=0 src="Images/spacer_4.jpg" height=21 width=5></td>
<td><img border=0 src="Images/nav_downloads.jpg" height=21 width=100 onMouseOver="this.src = 'Images/nav_downloads_hot.jpg' " onMouseOut="this.src = 'Images/nav_downloads.jpg' "></td>
<td><img border=0 src="Images/spacer_5.jpg" height=21 width=4></td>
<td><a href="phpBB2/index.php"><img border=0 src="Images/nav_forum.jpg" height=21 width=102 onMouseOver="this.src = 'Images/nav_forum_hot.jpg' " onMouseOut="this.src = 'Images/nav_forum.jpg' "></a></td>
<td><img border=0 src="Images/spacer_6.jpg" height=21 width=4></td>
<td><img border=0 src="Images/nav_news.jpg" height=21 width=101 onMouseOver="this.src = 'Images/nav_news_hot.jpg' " onMouseOut="this.src = 'Images/nav_news.jpg' "></td>
<td><img border=0 src="Images/spacer_7.jpg" height=21 width=4></td>
<td><a href="Contact.html"><img border=0 src="Images/nav_contact_us_hot.jpg" height=21 width=102></a></td>
<td><img border=0 src="Images/spacer_8.jpg" height=21 width=9></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/header_bottom.jpg" height=27 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=386>
<tr>
<td><img border=0 src="Images/border_left.jpg" height=386 width=20></td>
<td><table border=0 cellspacing=0 cellpadding=0 width=200 height=386>
<tr>
<td background="Images/body_div_1.jpg" height=25 width=200><div align="left"><span class="style3">Name</span></div></td>
</tr><tr>
<td background="Images/body_div_2.jpg" height=25 width=200><div align="left"><span class="form_div" style="margin-top0:px;">
  <input name="Name" type="text" class="form m_text" id="Name" size="28" />
</span></div></td>
</tr><tr>
<td background="Images/body_div3.jpg" height=25 width=200><div align="left"><span class="style3">Company</span></div></td>
</tr><tr>
<td background="Images/body_div_4.jpg" height=25 width=200><div align="left"><span class="form_div" style="margin-top0:px;">
  <input name="Company" type="text" class="form m_text" id="Company" size="28" />
</span></div></td>
</tr><tr>
<td background="Images/body_div_5.jpg" height=25 width=200><div align="left"><span class="style3">Phone</span></div></td>
</tr><tr>
<td background="Images/body_div_6.jpg" height=25 width=200><div align="left"><span class="form_div" style="margin-top0:px;">
  <input name="Phone" type="text" class="form m_text" id="Phone" size="28" />
</span></div></td>
</tr><tr>
<td background="Images/body_div_7.jpg" height=25 width=200><div align="left"><span class="style3">Email</span></div></td>
</tr><tr>
<td background="Images/body_div_8.jpg" height=25 width=200><div align="left"><span class="form_div" style="margin-top0:px;">
  <input name="Email" type="text" class="form m_text" id="Email" size="28" />
</span></div></td>
</tr><tr>
<td width=200 height=136 valign="bottom" background="Images/body_div_9.jpg"><p align="left" class="style3 style4"><span class="style6">Oceanlogics Inc</span><Br>
  1141 des Trilles<Br>
  Prevost, Quebec<Br>
   Canada J0R 1T0<Br>
</td>
</tr><tr>
<td background="Images/body_div_10.jpg" height=25 width=200><div align="left"><span class="style3">P/F: +001 (450) 669-8859</span></div></td>
</tr><tr>
<td background="Images/body_div_11.jpg" height=25 width=200> </td>
</tr>
</table></td>
<td><table border=0 cellspacing=0 cellpadding=0 width=510 height=386>
<tr>
<td background="Images/body_div_12.jpg" height=25 width=510><div align="right"><span class="style3" style="margin-top0:px;">Subject</span></div></td>
</tr><tr>
<td background="Images/body_div_13.jpg" height=25 width=510><div align="right"><span class="form_div" style="margin-top0:px;">
  <input name="Subject" type="text" class="form m_text" id="Subject" size="77" />
</span></div></td>
</tr><tr>
<td width=510 height=25 background="Images/body_div_14.jpg" class="style3"><div align="right">Message</div></td>
</tr><tr>
<td width=510 height=286 valign="top" background="Images/body_div_15.jpg"><div align="right"><span style="margin-top:0px">
  <textarea name="Message" cols="60" rows="10" class="form m_text" id="Message" style="height:260px; overflow:hidden"></textarea>
</span></div></td>
</tr><tr>
<td width=510 height=25 valign="bottom" background="Images/body_div_16.jpg"><div align="right" class="oneColFixCtr">
  <span style="margin-left:3px; margin-top:3px;"><span class="style7">Please enter the code appearing in the following picture</span><span style="margin-left:3px; margin-top:3px;"> <img src="Captcha.php" alt="captcha image" height="20" /></span></span><span class="_text" style="margin-left:3px; margin-top:3px;"><span class="_text" style="margin-left:3px; margin-top:3px;">
  <input type="text" name="captcha" size="6" maxlength="6">
  </span>
  <input type="submit" value="Submit">
  </span></div></td>
</tr>
</table></td>
<td><img border=0 src="Images/border_right.jpg" height=386 width=20></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/footer_top.jpg" height=47 width=750></td>
</tr><tr>
<td><table border=0 cellspacing=0 cellpadding=0 width=750 height=11>
<tr>
<td><img border=0 src="Images/spacer_9.jpg" height=11 width=51></td>
<td><img border=0 src="Images/nav_company.jpg" height=11 width=54></td>
<td><img border=0 src="Images/nav_support.jpg" height=11 width=50></td>
<td><img border=0 src="Images/nav_links.jpg" height=11 width=34></td>
<td><img border=0 src="Images/nav_upcoming_events.jpg" height=11 width=100></td>
<td><img border=0 src="Images/nav_faq.jpg" height=11 width=26></td>
<td><img border=0 src="Images/nav_our_clients.jpg" height=11 width=65></td>
<td><img border=0 src="Images/nav_pictures.jpg" height=11 width=52></td>
<td><img border=0 src="Images/nav_intranet.jpg" height=11 width=50></td>
<td><img border=0 src="Images/nav_webmail.jpg" height=11 width=53></td>
<td><img border=0 src="Images/nav_site_map.jpg" height=11 width=56></td>
<td><a href="Terms.html"><img border=0 src="Images/nav_terms_and_conditions.jpg" height=11 width=116></a></td>
<td><img border=0 src="Images/spacer_10.jpg" height=11 width=43></td>
</tr>
</table></td>
</tr><tr>
<td><img border=0 src="Images/footer_bottom.jpg" height=11 width=750></td>
</tr>
</table>
</div>

</body>

Related Questions

This is the very first question

Hello guys! This is the first post in this site Read More

Views

2k

Votes

4

Answers

2

January 08, 2016

report values not showing up.

I have a crystal report which I pass a DataSet to using VB.NET. The report was working fine, but then I make some changes to the import query and now nothing shows up in the crystal report. Crystal do Read More

Views

1k

Votes

0

Answers

12

September 06, 2005

Event log doesn't overwrite as needed in SP4

Hello All, After upgrading from SP3 to SP4 on several Windows 2000 PRO machines everything looked fine, but from time to time applications can&#39;t write to the event log. When I try to view the appl Read More

Views

1k

Votes

0

Answers

9

May 11, 2003

"Failed to self-register XYZ.dll"

Hi there, I wrote a OLE-automation-server DLL in VB4.0. I use Installshield Express to install it as part of my program on the target computers. Now on some computers I get the message &quot;Failed to Read More

Views

5k

Votes

0

Answers

2

November 08, 1998

Please help understand these notes on image processing

Can someone please help me understand these lecture notes... On the right of the page; What does &quot;normalised by one notion of the area of a pixel&quot; mean? On the first formula for A, Is that a Read More

Views

1k

Votes

0

Answers

3

February 05, 2009

Can someone please explain this paragram on the chain rule in image processing

Please see the screenshot, How is 3133030 got from 10103322? Read More

Views

1k

Votes

0

Answers

1

January 05, 2009

AD on 2003

We have created an AD Domain on Windows 2000 Server with no problems. We just created an AD Domain on Windows 2003 and we&#39;re getting some weird problems. Both of these domains are behind firewalls Read More

Views

1k

Votes

0

Answers

15

May 11, 2003

ADDT ASP Upload Error " Type mismatch: 'tNG_isFileInsideBaseFolder' "

I am trying to create a simple insert record and upload image function on an ASP page built using Adobe Dreamweaver Developer Toolkit. I have done this many times before with no problem, however, i ha Read More

Views

1k

Votes

0

Answers

0

November 02, 2008

MYSQL Select query with custom ORDER BY

Hi, is it possible to customize the order of the returned rows in mysql? Example: I have a Table with a column &quot;name&quot;, now I want to have all entries ordered by name, but I want the entries Read More

Views

1k

Votes

0

Answers

5

July 02, 2010

Folder Redirection in Server 2003

We have a Windows Server 2003 Standard Ed. Is there a way to redirect the users my documents to a folder that has already been created on the server? Read More

Views

1k

Votes

0

Answers

2

July 05, 2007

Partiton magic  version 8.0 having error 1523 while executing batch

I followed the partition magic 8.0 wizard to partition my hard disk while rebooting &#160;I came across this problem &#160;&quot;error 1523 while executing batch&quot; What can I do to solve this prob Read More

Views

1k

Votes

0

Answers

2

May 11, 2003

Please explain this paragraph in image processing (screenshot attached)

Two questions; How is the equation (10.1-15) formed? &quot;are isotropic for rotation increments of 90 degrees and 45 degrees respectively&quot; What does this mean Read More

Views

984

Votes

0

Answers

7

January 05, 2009

xp_cmdshell with net use

Hi, when I use &#39;net use \192.168.0.1\c$ password /user:username&#39; at the command prompt, it works fine. &#160;But if i try to use it in sql with &quot; exec master..xp_cmdshell &#39;net use \19 Read More

Views

917

Votes

0

Answers

5

April 11, 2003

hp ux11

i have a hp ux11 server. and i edited the /etc/resolv.conf to use my win2003 server dns server. That went fine, however, I would like to go the other way and add an entry on my win2003 dns to resolve Read More

Views

562

Votes

0

Answers

3

October 12, 2009

Using an application over a LAN

I have written an application that needs to be used on a LAN. &#160;The application setup wizard takes care of registering everything on a single PC, but how do you go about writing a setup program th Read More

Views

487

Votes

0

Answers

9

August 07, 1998

Need subnet of 12 IPs.

Please, Can someone help me to create a subnet consisting of 12 IP&#39;s. Thanks.. Read More

Views

486

Votes

0

Answers

5

April 11, 2003

Drill down in a cross-tabl report

Hello, Would some experts to show me if it is possible to do drill-up or drill-down (or both) in a cross-tab report? I would also like to know if it is possible to control what fields to be displayed/ Read More

Views

400

Votes

0

Answers

0

September 06, 2005

Using RDO, Enterprise V Professional

We would like to use RDO on our project made up of 4 developers. Do we need to have a copy of Enterprise for each developer or is it possible to use Professional for those developers not writing the R Read More

Views

470

Votes

0

Answers

6

January 07, 1998

Can't Edit IIS Metabase.xml

We do this on every windows 2003 server and never had an issue. We cannot edit the IIS Metabase.xml We have stopped IIS and made change click save, no problem but it does not take the new information. Read More

Views

463

Votes

0

Answers

0

July 05, 2007

copy directorires - HP UNIX

Let&#39;s say my source file is /A/B/C/D/file1, and mytarget directory is /E/F/G, I want the result should look like this. /E/F/G/A/B/C/D/file1 I am using rsync to copy the files older than x no of da Read More

Views

484

Votes

0

Answers

14

September 12, 2009