PHP - smartSolver 0.1 - Pre-Approval |
||
![]() Mar Tacheon Was playing with some old code I wrote a while ago. It splits the text entered into words, then checks against the supplied word. Very basic, but it's a start. Will look at validating from a text file next. Tach <?php
/*******************************************
* smartSolver.php. *
* *
* Version: 0.1 *
* *
* Date: 15th Feb 2005 *
* *
* Author: Tacheon *
* *
* Purpose: To validate text that has been *
* decrypted or decoded *
* *
*******************************************/
?>
<html>
<head>
<title>smartSolver 0.1</title>
</head>
<body bgcolor="#dddddd" text="#000000">
<br /><center><h2><b>SmartSolver 0.1</b></h2></center>
<?php
if (isset($submit))
{
echo "<table width=\"450\" border=\"1\" align=\"center\" cellspacing=\"0\" cellpadding=\"10\">\n";
echo " <tr valign=\"top\">\n";
echo " <td>\n";
if ($text == '' || $stringToVerify == '')
{
echo "<br /><font color=\"#ff0000\"><b>Error:</b> You must enter text into both boxes!</font><br /><br />\n";
}
else
{
echo "<b>Text Entered:</b><br /><br />$text<br /><br />\n";
$showResults = 'yes';
}
echo " </td>";
echo " </tr>";
echo "</table>";
echo "<br />";
if ($showResults == 'yes')
{
// Validate...
echo "<table width=\"450\" border=\"1\" align=\"center\" cellspacing=\"0\" cellpadding=\"10\">\n";
echo " <tr valign=\"top\">\n";
echo " <td>\n";
echo " <b>Results:</b><br /><br />\n";
$words = explode(' ', $text);
for($i=0;$i<count($words);$i++)
{
if ($words[$i] == $stringToVerify)
{
echo "<b>VERIFIED</b> - Text contines the test string '$stringToVerify'.<br /><br />\n";
break;
}
}
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<br />\n";
}
}
else
{
// Input Form...
?>
<center>
<form action="<?php echo($_SERVER['PHP_SELF']); ?>" method="post">
<table width="450" border="1" align="center" cellspacing = "0" cellpadding="10">
<tr valign="top">
<td>
<b>Text Entry:</b><br /><br />
<input type="text" name="text" size="64"><br /><br />
</td>
</tr>
</table>
<br />
<table width="450" border="1" align="center" cellspacing = "0" cellpadding="10">
<tr valign="top">
<td>
<b>Verification:</b><br /><br />
Verify With: <input type="text" name="stringToVerify" size="42"><br /><br />
</td>
</tr>
</table>
<br />
<table border="1" align="center" cellspacing = "0" cellpadding="10">
<tr valign="top">
<td>
<input type="submit" name="submit" value=" Submit " />
<input type="reset" value=" Clear " />
</td>
</tr>
</table>
</form>
</center>
<?php
} // End Submit Check.
echo " </body>\n";
echo "</html>\n";
?>
Mar. Tacheon
Brigade Coordinator Projects: ChalDev, IT News, CA-History, SNEAK Crypto-Net Replies:
|
||
| CyberArmy::Forum v0.6 Generated In 0.02727 seconds |