Confirmation Code Client
Confirmation Code Client Description
This source code written in PHP will allow you to use confirmation code on your pages to avoid automatic registration, for example.
Run Live Example
Register

We advise you to register for using this service (it is free) because if we will improve it, we have to let you know about this.

PHP code below is real web client for this purpose. Just copy and paste it, and use!
You do not need to use PHP for work with the service, it can be any internet programming language.

The web service returns the string ==========NCCC...QEEE... where
N - dimension of the confirmation code;
CCC... - the created randomly confirmation code;
Q - dimension of the encrypted confirmation code;
EEE... - the encrypted confirmation code.


<?
$ICHWORKSHost="www.vemix.com";$ICHWORKSURI="/ws/IChar/ICharService/IChar.php";

$sfvUName=@$_POST["fUName"];
if($sfvUName!==null)
{
  $sfvCocoCompare=@$_POST["fCocoCompare"];
  $sfvCocoEnc=@$_POST["fCocoEnc"];
}

$sReqBody="";
if(@$sfvCocoEnc!=null)
  $sReqBody="fce=".$sfvCocoEnc;
$sCocoB=ICHWORKreadPageDocument($ICHWORKSHost,$ICHWORKSURI,$sReqBody);
$qc=substr($sCocoB,0,1);
$sfvCoco=substr($sCocoB,1,$qc);$sfvCocoEnc=substr($sCocoB,$qc+2);

$bgo=false;
if($sfvUName!==null)
{
  if(strtoupper($sfvCocoCompare)==strtoupper($sfvCoco))
    $bgo=1;
  else
  {
    $bgo=0;
    $sCocoB=ICHWORKreadPageDocument($ICHWORKSHost,$ICHWORKSURI,"");
    $qc=substr($sCocoB,0,1);
    $sfvCoco=substr($sCocoB,1,$qc);$sfvCocoEnc=substr($sCocoB,$qc+2);
  }
}
/*f************/
function ICHWORKreadPageDocument($shost,$sURI,$sReqBody)
{
  $sans=false;

  $qcReqBody=strlen($sReqBody);
  $sReqHeader="POST $sURI HTTP/1.1\r\n";
  $sReqHeader.="Host: $shost\r\n";
  $sReqHeader.="Content-Type: application/x-www-form-urlencoded\r\n";
  $sReqHeader.="Connection: close\r\n";
  $sReqHeader.="Content-Length: $qcReqBody\r\n\r\n";
  $sReqHeader.="$sReqBody\r\n";

  $socket=fsockopen($shost,80,$nerr,$serr);
  if($socket)
  {
    fputs($socket,$sReqHeader);
    for($sans="";!feof($socket);)
      $sans.=fgets($socket,1024);
    fclose($socket);

    $stof="==========";
    $nc=strpos($sans,$stof);
    if($nc!==false)
    {
      $sans=substr($sans,$nc+strlen($stof));
      $nc=strpos($sans,"\r\n");
      if($nc===false)
        $nc=strlen($sans);
      $sans=substr($sans,0,$nc);
    }
    else
      $sans=false;
  }

  return $sans;
}
?>
<html>
  <head>
    <title>Sample of Confirmation Code Client Page</title>
  </head>
  <body>
    <form name='fmMain' method='POST'>
      <input type='hidden' name='fCocoEnc' value="<?echo($sfvCocoEnc);?>">
      <table border='0'>
        <tr>
          <td><a href='http://www.vemix.com'>VEMIX Home</a></td>
        </tr>
        <tr>
          <td colspan='2'><a href='ICharClientTest.php'>From the Very Beginning</a></td>
        </tr>
        <tr>
          <td colspan='2' height='20'>
<?
if($bgo===1)
{
?>
            <font color='#990000'>Redirect to the next page...</font>
<?
}
?>
<?
if($bgo===0)
{
?>
            <font color='#FF0000'><b>Confirmation Code does not match...</b></font>
<?
}
?>
          </td>
        </tr>
<?
if($bgo!==1)
{
?>
        <tr>
          <td align='right'>Create Your Account Name:</td>
          <td>
            <input type='text' name='fUName' value="<?echo($sfvUName);?>">
          </td>
        </tr>
        <tr>
          <td align='right'>Password:</td>
          <td>
            ...
          </td>
        </tr>
        <tr>
          <td></td>
          <td>...<br>...<br>...</td>
        </tr>
        <tr>
          <td></td>
          <td>
<?
$surl="http://".$ICHWORKSHost.$ICHWORKSURI."?fce=".$sfvCocoEnc;
?>
            <img src="<?echo($surl);?>">
          </td>
        </tr>
        <tr>
          <td align='right'>Enter Confirmation Code That You See Above:</td>
          <td>
            <input type='text' name='fCocoCompare'>
          </td>
        </tr>
        <tr>
          <td></td>
          <td>
            <input type='submit' value='Submit'>
          </td>
        </tr>
<?
}
?>
      </table>
    </form>
  </body>
</html>

To register for this service, submit your email address, please:
Your Email:
Remarks
leonard waldner
2007-12-10 12:36:17
msn
harpreet singh
2007-03-23 01:07:55
code of email confirmation
Vinit kumar
2006-12-16 03:19:23
Your tutorial is great
Add Your Remark:
Your Name*:
Email:
Hide Email    Subscribe to Site News
Web Site:
Message*: