Jump to content

Captcha Code - Easy Fix I am Sure


winuser2003

Recommended Posts

I am trying to impliment a captcha to my site, and I got everything working but when I hit the submit button nothing happens. Here is the link to the actual site...

 

http://bapr.isgreat.org/store/administration.php?pageaction=newstore

 

and here is my php code where I put in the catpcha code

 

<?php

// ----------------------------------------------------------------------
//   File        : inc_newstore.php
//   Description : displays form to enter a new store record
//   Version     : 1.0
//   Created     : 1/6/2007
//
//   Copyright (c) 2007. All rights reserved.
//
// ----------------------------------------------------------------------

include("inc_security.php");

global $strFormadminstate;

screenheading("New Party Room Submission");

print("<form action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">\n");
print("<input type=\"hidden\" name=\"pageaction\" value=\"savestore\">\n");
print $strFormadminstate;
print("<table class=\"newtable\" width=\"572\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\n");
print("  <tr>\n");
print("    <td width=\"110\" class=\"newhead\"> Party Room Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"companystoreID\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Room Capacity</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"suburb\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Business Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storename\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Address</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"address\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> City</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"city\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> State</td>\n");
print("    <td class=\"newtext\">");

include ("statedropdown.php");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Zip / Post Code</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"zippostcode\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 1</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone1\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 2</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone2\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Fax</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"fax\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Email</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"email\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Website</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"website\" size=\"50\"></td>\n");
print("  </tr>\n");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Choose Hosted Occasions </td>\n");
print("    <td class=\"newtext\">");

countrydropdown();

print("</td>\n");


print("  <tr>\n");
print("    <td class=\"newhead\">A Brief Description of Your<br /> Party Room<br /></td>\n");
print("    <td class=\"newtext\"><textarea name=\"description\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onkeydown=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onmouseout=\"CheckFieldLength(description, 'charcount1', 'remaining1',255);\"></textarea><br>\n");
print("<small><span id=\"charcount1\">0</span> characters entered.   |   <span id=\"remaining1\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Party Room Hours</td>\n");
print("    <td class=\"newtext\">\n");

print("<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">");
print("  <tr>\n");
print("    <td></td><td class=\"hourshead\">OPEN</td><td class=\"hourshead\">CLOSE</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Monday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openmonday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closemonday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Tuesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opentuesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closetuesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Wednesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openwednesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closewednesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Thursday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openthursday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closethursday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Friday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openfriday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closefriday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Saturday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensaturday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesaturday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Sunday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensunday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesunday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("</table>\n");
print("<br>\n");
print("Other hours information<br>\n");
print("<textarea name=\"opencloseinfo\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onkeydown=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onmouseout=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2',255);\"></textarea><br>\n");
print("<small><span id=\"charcount2\">0</span> characters entered.   |   <span id=\"remaining2\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Manager</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storemanager\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Map Link</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"maplink\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Directions</td>\n");
print("    <td class=\"newtext\"><textarea name=\"directions\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onkeydown=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onmouseout=\"CheckFieldLength(direcitons, 'charcount3', 'remaining3',255);\"></textarea><br>\n");
print("<small><span id=\"charcount3\">0</span> characters entered.   |   <span id=\"remaining3\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Active</td>\n");
print("    <td class=\"newtext\"><input type=\"checkbox\" name=\"recordstatus\" value=\"active\" checked></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td> </td>\n");
print("  </tr>\n");
print("</table>\n");
print("</form>\n");
print '<img src="captcha/easycaptcha.php" /><br />

Enter code from above image: 
	<input type="text" name="confirm_code" />';
print("    <td><input type=\"submit\" value=\"Submit\"></td>\n");
print("</table>\n");
print("</form>\n");

print("<div id=\"bottomspacer\"></div>\n");



?>

 

Just trying to get the submit button to work correctly and verify the captcha code was entered in correctly. Here is the link where I found to use the Captcha system

 

http://kestas.kuliukas.com/EasyCaptcha/

 

Thanks for your help!!

Link to comment
Share on other sites

Hi! This is some interestingly formatted code... Have you tried using "echo" it will make your code much cleaner. Anyway, to me it looks like you have your form going to your page, but once it goes to the page, there's no if statement that will do the code you need!

Link to comment
Share on other sites

Here is a newly added code, unsure if this will make a difference, but now everything within the captcha is linking.

 

<?php

// ----------------------------------------------------------------------
//   File        : inc_newstore.php
//   Description : displays form to enter a new store record
//   Version     : 1.0
//   Created     : 1/6/2007
//
//   Copyright (c) 2007. All rights reserved.
//
// ----------------------------------------------------------------------

include("inc_security.php");

global $strFormadminstate;

screenheading("New Party Room Submission");

print("<form action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">\n");
print("<input type=\"hidden\" name=\"pageaction\" value=\"savestore\">\n");
print $strFormadminstate;
print("<table class=\"newtable\" width=\"572\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\n");
print("  <tr>\n");
print("    <td width=\"110\" class=\"newhead\"> Party Room Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"companystoreID\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Room Capacity</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"suburb\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Business Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storename\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Address</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"address\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> City</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"city\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> State</td>\n");
print("    <td class=\"newtext\">");

include ("statedropdown.php");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Zip / Post Code</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"zippostcode\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 1</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone1\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 2</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone2\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Fax</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"fax\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Email</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"email\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Website</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"website\" size=\"50\"></td>\n");
print("  </tr>\n");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Choose Hosted Occasions </td>\n");
print("    <td class=\"newtext\">");

countrydropdown();

print("</td>\n");


print("  <tr>\n");
print("    <td class=\"newhead\">A Brief Description of Your<br /> Party Room<br /></td>\n");
print("    <td class=\"newtext\"><textarea name=\"description\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onkeydown=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onmouseout=\"CheckFieldLength(description, 'charcount1', 'remaining1',255);\"></textarea><br>\n");
print("<small><span id=\"charcount1\">0</span> characters entered.   |   <span id=\"remaining1\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Party Room Hours</td>\n");
print("    <td class=\"newtext\">\n");

print("<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">");
print("  <tr>\n");
print("    <td></td><td class=\"hourshead\">OPEN</td><td class=\"hourshead\">CLOSE</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Monday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openmonday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closemonday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Tuesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opentuesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closetuesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Wednesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openwednesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closewednesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Thursday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openthursday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closethursday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Friday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openfriday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closefriday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Saturday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensaturday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesaturday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Sunday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensunday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesunday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("</table>\n");
print("<br>\n");
print("Other hours information<br>\n");
print("<textarea name=\"opencloseinfo\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onkeydown=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onmouseout=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2',255);\"></textarea><br>\n");
print("<small><span id=\"charcount2\">0</span> characters entered.   |   <span id=\"remaining2\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Manager</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storemanager\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Map Link</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"maplink\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Directions</td>\n");
print("    <td class=\"newtext\"><textarea name=\"directions\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onkeydown=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onmouseout=\"CheckFieldLength(direcitons, 'charcount3', 'remaining3',255);\"></textarea><br>\n");
print("<small><span id=\"charcount3\">0</span> characters entered.   |   <span id=\"remaining3\">255</span> characters remaining.</small>\n");
   
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Active</td>\n");
print("    <td class=\"newtext\"><input type=\"checkbox\" name=\"recordstatus\" value=\"active\" checked></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td> </td>\n");
print("  </tr>\n");
print("</table>\n");
print("</form>\n");
print '<img src="captcha/easycaptcha.php" /><br />

Enter code from above image: 
	<input type="text" name="confirm_code" />';
print("    <td><input type=\"submit\" value=\"Submit\"></td>\n");
if (empty($_REQUEST['confirm_code']))
{
die("");
}
else
{
if ( isset($_COOKIE['Captcha']) )
{
	list($Hash, $Time) = explode('.', $_COOKIE['Captcha']);
	if ( md5("OASDOIJQWOIJDASDOI".$_REQUEST['confirm_code'].$_SERVER['REMOTE_ADDR'].$Time) != $Hash )
	{
		die("Captcha code is wrong.");
	}
	elseif( (time() - 5*60) > $Time)
	{
		die("Captcha code is only valid for 5 minutes.");
	}
}
else
{
	die("No captcha cookie given. Make sure cookies are enabled.");
}
}


print("<div id=\"bottomspacer\"></div>\n");



?>

 

Here is the test site link...

 

http://bapr.isgreat.org/store/administration.php?pageaction=newstore

Link to comment
Share on other sites

Good Call, I should have caught that thank you very much, however even with that being changed, I can put any code I want in and it just goes on through. The goal is to stop spammers and prove they are humans. Here is the code changed...

 

<?php

// ----------------------------------------------------------------------
//   File        : inc_newstore.php
//   Description : displays form to enter a new store record
//   Version     : 1.0
//   Created     : 1/6/2007
//
//   Copyright (c) 2007. All rights reserved.
//
// ----------------------------------------------------------------------

include("inc_security.php");

global $strFormadminstate;

screenheading("New Party Room Submission");

print("<form action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">\n");
print("<input type=\"hidden\" name=\"pageaction\" value=\"savestore\">\n");
print $strFormadminstate;
print("<table class=\"newtable\" width=\"572\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\n");
print("  <tr>\n");
print("    <td width=\"110\" class=\"newhead\"> Party Room Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"companystoreID\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Room Capacity</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"suburb\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Business Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storename\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Address</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"address\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> City</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"city\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> State</td>\n");
print("    <td class=\"newtext\">");

include ("statedropdown.php");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Zip / Post Code</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"zippostcode\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 1</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone1\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 2</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone2\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Fax</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"fax\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Email</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"email\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Website</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"website\" size=\"50\"></td>\n");
print("  </tr>\n");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Choose Hosted Occasions </td>\n");
print("    <td class=\"newtext\">");

countrydropdown();

print("</td>\n");


print("  <tr>\n");
print("    <td class=\"newhead\">A Brief Description of Your<br /> Party Room<br /></td>\n");
print("    <td class=\"newtext\"><textarea name=\"description\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onkeydown=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onmouseout=\"CheckFieldLength(description, 'charcount1', 'remaining1',255);\"></textarea><br>\n");
print("<small><span id=\"charcount1\">0</span> characters entered.   |   <span id=\"remaining1\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Party Room Hours</td>\n");
print("    <td class=\"newtext\">\n");

print("<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">");
print("  <tr>\n");
print("    <td></td><td class=\"hourshead\">OPEN</td><td class=\"hourshead\">CLOSE</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Monday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openmonday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closemonday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Tuesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opentuesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closetuesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Wednesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openwednesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closewednesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Thursday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openthursday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closethursday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Friday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openfriday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closefriday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Saturday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensaturday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesaturday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Sunday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensunday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesunday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("</table>\n");
print("<br>\n");
print("Other hours information<br>\n");
print("<textarea name=\"opencloseinfo\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onkeydown=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onmouseout=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2',255);\"></textarea><br>\n");
print("<small><span id=\"charcount2\">0</span> characters entered.   |   <span id=\"remaining2\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Manager</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storemanager\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Map Link</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"maplink\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Directions</td>\n");
print("    <td class=\"newtext\"><textarea name=\"directions\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onkeydown=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onmouseout=\"CheckFieldLength(direcitons, 'charcount3', 'remaining3',255);\"></textarea><br>\n");
print("<small><span id=\"charcount3\">0</span> characters entered.   |   <span id=\"remaining3\">255</span> characters remaining.</small>\n");
   
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Active</td>\n");
print("    <td class=\"newtext\"><input type=\"checkbox\" name=\"recordstatus\" value=\"active\" checked></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td> </td>\n");
print("  </tr>\n");
print("</table>\n");


print '<img src="captcha/easycaptcha.php" /><br />

Enter code from above image: 
	<input type="text" name="confirm_code" />';
print("    <td><input type=\"submit\" value=\"Submit\"></td>\n");
if (empty($_REQUEST['confirm_code']))
{
die("");
}
else
{
if ( isset($_COOKIE['Captcha']) )
{
	list($Hash, $Time) = explode('.', $_COOKIE['Captcha']);
	if ( md5("OASDOIJQWOIJDASDOI".$_REQUEST['confirm_code'].$_SERVER['REMOTE_ADDR'].$Time) != $Hash )
	{
		die("Captcha code is wrong.");
	}
	elseif( (time() - 5*60) > $Time)
	{
		die("Captcha code is only valid for 5 minutes.");
	}
}
else
{
	die("No captcha cookie given. Make sure cookies are enabled.");
}
}

print("</form>\n");
print("<div id=\"bottomspacer\"></div>\n");



?>

 

You can see I moved it, and does work, however when I put the code in, no matter what it is still goes on through. I want to prevent spammers for jumping on this thing. Your thoughts?

Link to comment
Share on other sites

Here is where I got my captcha php code from...

 

http://kestas.kuliukas.com/EasyCaptcha/

 

unless you can suggest a better captcha system I should impliment. I thought the cookie setting code was this..

 

if (empty($_REQUEST['confirm_code']))
{
die("Confirm code not given.");
}
else
{
if ( isset($_COOKIE['Captcha']) )
{
	list($Hash, $Time) = explode('.', $_COOKIE['Captcha']);
	if ( md5("OASDOIJQWOIJDASDOI".$_REQUEST['confirm_code'].$_SERVER['REMOTE_ADDR'].$Time) != $Hash )
	{
		die("Captcha code is wrong.");
	}
	elseif( (time() - 5*60) > $Time)
	{
		die("Captcha code is only valid for 5 minutes.");
	}
}
else
{
	die("No captcha cookie given. Make sure cookies are enabled.");
}
}

 

is this not correct?

Link to comment
Share on other sites

I tested that, unfortunately same result.. here is the code with the change

 

<?php

// ----------------------------------------------------------------------
//   File        : inc_newstore.php
//   Description : displays form to enter a new store record
//   Version     : 1.0
//   Created     : 1/6/2007
//
//   Copyright (c) 2007. All rights reserved.
//
// ----------------------------------------------------------------------

include("inc_security.php");

global $strFormadminstate;

screenheading("New Party Room Submission");

print("<form action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">\n");
print("<input type=\"hidden\" name=\"pageaction\" value=\"savestore\">\n");
print $strFormadminstate;
print("<table class=\"newtable\" width=\"572\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\n");
print("  <tr>\n");
print("    <td width=\"110\" class=\"newhead\"> Party Room Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"companystoreID\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Room Capacity</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"suburb\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Business Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storename\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Address</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"address\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> City</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"city\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> State</td>\n");
print("    <td class=\"newtext\">");

include ("statedropdown.php");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Zip / Post Code</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"zippostcode\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 1</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone1\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 2</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone2\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Fax</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"fax\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Email</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"email\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Website</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"website\" size=\"50\"></td>\n");
print("  </tr>\n");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Choose Hosted Occasions </td>\n");
print("    <td class=\"newtext\">");

countrydropdown();

print("</td>\n");


print("  <tr>\n");
print("    <td class=\"newhead\">A Brief Description of Your<br /> Party Room<br /></td>\n");
print("    <td class=\"newtext\"><textarea name=\"description\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onkeydown=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onmouseout=\"CheckFieldLength(description, 'charcount1', 'remaining1',255);\"></textarea><br>\n");
print("<small><span id=\"charcount1\">0</span> characters entered.   |   <span id=\"remaining1\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Party Room Hours</td>\n");
print("    <td class=\"newtext\">\n");

print("<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">");
print("  <tr>\n");
print("    <td></td><td class=\"hourshead\">OPEN</td><td class=\"hourshead\">CLOSE</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Monday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openmonday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closemonday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Tuesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opentuesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closetuesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Wednesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openwednesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closewednesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Thursday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openthursday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closethursday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Friday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openfriday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closefriday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Saturday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensaturday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesaturday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Sunday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensunday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesunday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("</table>\n");
print("<br>\n");
print("Other hours information<br>\n");
print("<textarea name=\"opencloseinfo\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onkeydown=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onmouseout=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2',255);\"></textarea><br>\n");
print("<small><span id=\"charcount2\">0</span> characters entered.   |   <span id=\"remaining2\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Manager</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storemanager\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Map Link</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"maplink\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Directions</td>\n");
print("    <td class=\"newtext\"><textarea name=\"directions\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onkeydown=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onmouseout=\"CheckFieldLength(direcitons, 'charcount3', 'remaining3',255);\"></textarea><br>\n");
print("<small><span id=\"charcount3\">0</span> characters entered.   |   <span id=\"remaining3\">255</span> characters remaining.</small>\n");
   
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Active</td>\n");
print("    <td class=\"newtext\"><input type=\"checkbox\" name=\"recordstatus\" value=\"active\" checked></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td> </td>\n");
print("  </tr>\n");
print("</table>\n");


print '<img src="captcha/easycaptcha.php" /><br />

Enter code from above image: 
	<input type="text" name="confirm_code" />';
print("    <td><input type=\"submit\" value=\"Submit\"></td>\n");
if (empty($_REQUEST['confirm_code']))
{
die("");
}
else
{
if ( isset($_COOKIE['Captcha']) )
{
	list($Hash, $Time) = explode('.', $_COOKIE['Captcha']);
	if ( md5("OASDOIJQWOIJDASDOI".$_REQUEST['confirm_code'].$_SERVER['REMOTE_ADDR'].$Time) != $Hash )
	{
		die("Captcha code is wrong.");
	}
	elseif( (time() - 5*60) > $Time)
	{
		die("Captcha code is only valid for 5 minutes.");
	}
}
else
{
	die("No captcha cookie given. Make sure cookies are enabled.");
}
}

print("<form action=\"{$_SERVER['REQUEST_URI']}\" method=\"post\">\n");
print("<div id=\"bottomspacer\"></div>\n");



?>

 

 

Link to comment
Share on other sites

You didnt make the change at all.. you just put it at the bottom of the script...

Im talking about the one up here

 

include("inc_security.php");

global $strFormadminstate;

screenheading("New Party Room Submission");

print("<form action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">\n");

Link to comment
Share on other sites

Same result here is the code changed again, you can also visit the site and see...

 

the code...

 

<?php

// ----------------------------------------------------------------------
//   File        : inc_newstore.php
//   Description : displays form to enter a new store record
//   Version     : 1.0
//   Created     : 1/6/2007
//
//   Copyright (c) 2007. All rights reserved.
//
// ----------------------------------------------------------------------

include("inc_security.php");

global $strFormadminstate;

screenheading("New Party Room Submission");

print("<form action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">\n");

print("<form action=\"{$_SERVER['PHP_SELF']}\" method=\"post\">\n");
print("<input type=\"hidden\" name=\"pageaction\" value=\"savestore\">\n");
print $strFormadminstate;
print("<table class=\"newtable\" width=\"572\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\n");
print("  <tr>\n");
print("    <td width=\"110\" class=\"newhead\"> Party Room Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"companystoreID\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Room Capacity</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"suburb\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Business Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storename\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Address</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"address\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> City</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"city\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> State</td>\n");
print("    <td class=\"newtext\">");

include ("statedropdown.php");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Zip / Post Code</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"zippostcode\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 1</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone1\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 2</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone2\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Fax</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"fax\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Email</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"email\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Website</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"website\" size=\"50\"></td>\n");
print("  </tr>\n");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Choose Hosted Occasions </td>\n");
print("    <td class=\"newtext\">");

countrydropdown();

print("</td>\n");


print("  <tr>\n");
print("    <td class=\"newhead\">A Brief Description of Your<br /> Party Room<br /></td>\n");
print("    <td class=\"newtext\"><textarea name=\"description\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onkeydown=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onmouseout=\"CheckFieldLength(description, 'charcount1', 'remaining1',255);\"></textarea><br>\n");
print("<small><span id=\"charcount1\">0</span> characters entered.   |   <span id=\"remaining1\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Party Room Hours</td>\n");
print("    <td class=\"newtext\">\n");

print("<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">");
print("  <tr>\n");
print("    <td></td><td class=\"hourshead\">OPEN</td><td class=\"hourshead\">CLOSE</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Monday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openmonday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closemonday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Tuesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opentuesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closetuesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Wednesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openwednesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closewednesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Thursday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openthursday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closethursday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Friday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openfriday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closefriday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Saturday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensaturday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesaturday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Sunday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensunday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesunday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("</table>\n");
print("<br>\n");
print("Other hours information<br>\n");
print("<textarea name=\"opencloseinfo\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onkeydown=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onmouseout=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2',255);\"></textarea><br>\n");
print("<small><span id=\"charcount2\">0</span> characters entered.   |   <span id=\"remaining2\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Manager</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storemanager\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Map Link</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"maplink\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Directions</td>\n");
print("    <td class=\"newtext\"><textarea name=\"directions\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onkeydown=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onmouseout=\"CheckFieldLength(direcitons, 'charcount3', 'remaining3',255);\"></textarea><br>\n");
print("<small><span id=\"charcount3\">0</span> characters entered.   |   <span id=\"remaining3\">255</span> characters remaining.</small>\n");
   
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Active</td>\n");
print("    <td class=\"newtext\"><input type=\"checkbox\" name=\"recordstatus\" value=\"active\" checked></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td> </td>\n");
print("  </tr>\n");
print("</table>\n");


print '<img src="captcha/easycaptcha.php" /><br />

Enter code from above image: 
	<input type="text" name="confirm_code" />';
print("    <td><input type=\"submit\" value=\"Submit\"></td>\n");
if (empty($_REQUEST['confirm_code']))
{
die("");
}
else
{
if ( isset($_COOKIE['Captcha']) )
{
	list($Hash, $Time) = explode('.', $_COOKIE['Captcha']);
	if ( md5("OASDOIJQWOIJDASDOI".$_REQUEST['confirm_code'].$_SERVER['REMOTE_ADDR'].$Time) != $Hash )
	{
		die("Captcha code is wrong.");
	}
	elseif( (time() - 5*60) > $Time)
	{
		die("Captcha code is only valid for 5 minutes.");
	}
}
else
{
	die("No captcha cookie given. Make sure cookies are enabled.");
}
}

print("</form>\n");
print("<div id=\"bottomspacer\"></div>\n");



?>

 

The site link...

 

http://bapr.isgreat.org/store/administration.php?pageaction=newstore

 

and finally where I got my captcha from...

 

http://kestas.kuliukas.com/EasyCaptcha/

 

this really should not be that hard, I know the answer is right in front of me. I appreciate you helping me out with this... thank you

Link to comment
Share on other sites

I dont want to sound mean but WTF...

I said REPLACE and the second time you did it you didnt even CHANGE the variable..

 

HERE...

<?php

// ----------------------------------------------------------------------
//   File        : inc_newstore.php
//   Description : displays form to enter a new store record
//   Version     : 1.0
//   Created     : 1/6/2007
//
//   Copyright (c) 2007. All rights reserved.
//
// ----------------------------------------------------------------------

include("inc_security.php");

global $strFormadminstate;

screenheading("New Party Room Submission");

print("<form action=\"{$_SERVER['REQUEST_URI']}\" method=\"post\">\n");
print("<input type=\"hidden\" name=\"pageaction\" value=\"savestore\">\n");
print $strFormadminstate;
print("<table class=\"newtable\" width=\"572\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\n");
print("  <tr>\n");
print("    <td width=\"110\" class=\"newhead\"> Party Room Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"companystoreID\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Room Capacity</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"suburb\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Business Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storename\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Address</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"address\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> City</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"city\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> State</td>\n");
print("    <td class=\"newtext\">");

include ("statedropdown.php");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Zip / Post Code</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"zippostcode\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 1</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone1\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 2</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone2\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Fax</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"fax\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Email</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"email\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Website</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"website\" size=\"50\"></td>\n");
print("  </tr>\n");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Choose Hosted Occasions </td>\n");
print("    <td class=\"newtext\">");

countrydropdown();

print("</td>\n");


print("  <tr>\n");
print("    <td class=\"newhead\">A Brief Description of Your<br /> Party Room<br /></td>\n");
print("    <td class=\"newtext\"><textarea name=\"description\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onkeydown=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onmouseout=\"CheckFieldLength(description, 'charcount1', 'remaining1',255);\"></textarea><br>\n");
print("<small><span id=\"charcount1\">0</span> characters entered.   |   <span id=\"remaining1\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Party Room Hours</td>\n");
print("    <td class=\"newtext\">\n");

print("<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">");
print("  <tr>\n");
print("    <td></td><td class=\"hourshead\">OPEN</td><td class=\"hourshead\">CLOSE</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Monday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openmonday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closemonday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Tuesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opentuesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closetuesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Wednesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openwednesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closewednesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Thursday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openthursday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closethursday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Friday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openfriday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closefriday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Saturday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensaturday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesaturday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Sunday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensunday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesunday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("</table>\n");
print("<br>\n");
print("Other hours information<br>\n");
print("<textarea name=\"opencloseinfo\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onkeydown=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onmouseout=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2',255);\"></textarea><br>\n");
print("<small><span id=\"charcount2\">0</span> characters entered.   |   <span id=\"remaining2\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Manager</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storemanager\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Map Link</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"maplink\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Directions</td>\n");
print("    <td class=\"newtext\"><textarea name=\"directions\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onkeydown=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onmouseout=\"CheckFieldLength(direcitons, 'charcount3', 'remaining3',255);\"></textarea><br>\n");
print("<small><span id=\"charcount3\">0</span> characters entered.   |   <span id=\"remaining3\">255</span> characters remaining.</small>\n");
   
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Active</td>\n");
print("    <td class=\"newtext\"><input type=\"checkbox\" name=\"recordstatus\" value=\"active\" checked></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td> </td>\n");
print("  </tr>\n");
print("</table>\n");


print '<img src="captcha/easycaptcha.php" /><br />
   
   Enter code from above image: 
      <input type="text" name="confirm_code" />';
print("    <td><input type=\"submit\" value=\"Submit\"></td>\n");
if (empty($_REQUEST['confirm_code']))
{
   die("");
}
else
{
   if ( isset($_COOKIE['Captcha']) )
   {
      list($Hash, $Time) = explode('.', $_COOKIE['Captcha']);
      if ( md5("OASDOIJQWOIJDASDOI".$_REQUEST['confirm_code'].$_SERVER['REMOTE_ADDR'].$Time) != $Hash )
      {
         die("Captcha code is wrong.");
      }
      elseif( (time() - 5*60) > $Time)
      {
         die("Captcha code is only valid for 5 minutes.");
      }
   }
   else
   {
      die("No captcha cookie given. Make sure cookies are enabled.");
   }
}

print("</form>\n");
print("<div id=\"bottomspacer\"></div>\n");

 

Can you see what I have done here?!?!

Link to comment
Share on other sites

I am sorry man, I really am doing my best here. The captcha just is not working for some reason, because it keeps going to the submission successful page. Sort of seems its ignoring the captcha code all together. I maybe wrong, but I think the submit button code is wrong.

Link to comment
Share on other sites

I am aware that your submit button is wrong and that is what we are addressing.. When you press submit it essentially takes you to the forms 'action' attribute.. your action attribute is currently going to /store/administration.php but you need it to goto /store/administration.php?pageaction=newstore

 

And my script change will fix that and let us know if you getting any other errors.. This is the first step..

Link to comment
Share on other sites

I think I know where we are going wrong here. When I setup the email for the submit button I edited the inc_savestore.php file. So when I do hit the submit button it sends out an email. Correct me if I am wrong, but would i also have to add the captcha system into this same code as well? here is the inc_savestore.php code...

 

<?php

// ----------------------------------------------------------------------
//   File        : inc_savestore.php
//   Description : saves a store record
//   Version     : 1.0
//   Created     : 1/6/2007
//
//   Copyright (c) 2007. All rights reserved.
//
// ----------------------------------------------------------------------

include("inc_security.php");

screenheading("Save store record");

//accept and cleanse fields
if (isset($_REQUEST['companystoreID']))
   $strCompanystoreID = addslashes($_REQUEST['companystoreID']);
else
   $strCompanystoreID = NULL;

if (isset($_REQUEST['storename']))
   $strStorename = addslashes($_REQUEST['storename']);
else
   $strStorename = NULL;

if (isset($_REQUEST['address']))
   $strAddress = addslashes($_REQUEST['address']);
else
   $strAddress = NULL;

if (isset($_REQUEST['city']))
   $strCity = addslashes($_REQUEST['city']);
else
   $strCity = NULL;

if (isset($_REQUEST['suburb']))
   $strSuburb = addslashes($_REQUEST['suburb']);
else
   $strSuburb = NULL;

if (isset($_REQUEST['stateID']))
   $strStateID = addslashes($_REQUEST['stateID']);
else
   $strStateID = NULL;

if (isset($_REQUEST['country']))
   $strCountry = addslashes(implode(',',$_REQUEST['country']));
else
   $strCountry = NULL;

if (isset($_REQUEST['zippostcode']))
   $strZippostcode = addslashes($_REQUEST['zippostcode']);
else
   $strZippostcode = NULL;

if (isset($_REQUEST['telephone1']))
   $strTelephone1 = addslashes($_REQUEST['telephone1']);
else
   $strTelephone1 = NULL;

if (isset($_REQUEST['telephone2']))
   $strTelephone2 = addslashes($_REQUEST['telephone2']);
else
   $strTelephone2 = NULL;

if (isset($_REQUEST['fax']))
   $strFax = addslashes($_REQUEST['fax']);
else
   $strFax = NULL;

if (isset($_REQUEST['email']))
   $strEmail = addslashes($_REQUEST['email']);
else
   $strEmail = NULL;

if (isset($_REQUEST['website']))
   $strWebsite = addslashes($_REQUEST['website']);
else
   $strWebsite = NULL;

if (isset($_REQUEST['description']))
   $strDescription = addslashes($_REQUEST['description']);
else
   $strDescription = NULL;

if (isset($_REQUEST['openmonday']))
   $strOpenmonday = addslashes($_REQUEST['openmonday']);
else
   $strOpenmonday = NULL;

if (isset($_REQUEST['closemonday']))
   $strClosemonday = addslashes($_REQUEST['closemonday']);
else
   $strClosemonday = NULL;

if (isset($_REQUEST['opentuesday']))
   $strOpentuesday = addslashes($_REQUEST['opentuesday']);
else
   $strOpentuesday = NULL;

if (isset($_REQUEST['closetuesday']))
   $strClosetuesday = addslashes($_REQUEST['closetuesday']);
else
   $strClosetuesday = NULL;

if (isset($_REQUEST['openwednesday']))
   $strOpenwednesday = addslashes($_REQUEST['openwednesday']);
else
   $strOpenwednesday = NULL;

if (isset($_REQUEST['closewednesday']))
   $strClosewednesday = addslashes($_REQUEST['closewednesday']);
else
   $strClosewednesday = NULL;

if (isset($_REQUEST['openthursday']))
   $strOpenthursday = addslashes($_REQUEST['openthursday']);
else
   $strOpenthursday = NULL;

if (isset($_REQUEST['closethursday']))
   $strClosethursday = addslashes($_REQUEST['closethursday']);
else
   $strClosethursday = NULL;

if (isset($_REQUEST['openfriday']))
   $strOpenfriday = addslashes($_REQUEST['openfriday']);
else
   $strOpenfriday = NULL;

if (isset($_REQUEST['closefriday']))
   $strClosefriday = addslashes($_REQUEST['closefriday']);
else
   $strClosefriday = NULL;

if (isset($_REQUEST['opensaturday']))
   $strOpensaturday = addslashes($_REQUEST['opensaturday']);
else
   $strOpensaturday = NULL;

if (isset($_REQUEST['closesaturday']))
   $strClosesaturday = addslashes($_REQUEST['closesaturday']);
else
   $strClosesaturday = NULL;

if (isset($_REQUEST['opensunday']))
   $strOpensunday = addslashes($_REQUEST['opensunday']);
else
   $strOpensunday = NULL;

if (isset($_REQUEST['closesunday']))
   $strClosesunday = addslashes($_REQUEST['closesunday']);
else
   $strClosesunday = NULL;

if (isset($_REQUEST['opencloseinfo']))
   $strOpencloseinfo = addslashes($_REQUEST['opencloseinfo']);
else
   $strOpencloseinfo = NULL;

if (isset($_REQUEST['storemanager']))
   $strStoremanager = addslashes($_REQUEST['storemanager']);
else
   $strStoremanager = NULL;

if (isset($_REQUEST['maplink']))
   $strMaplink = addslashes($_REQUEST['maplink']);
else
   $strMaplink = NULL;

if (isset($_REQUEST['directions']))
   $strDirections = addslashes($_REQUEST['directions']);
else
   $strDirections = NULL;

if (isset($_REQUEST['recordstatus']))
   $strRecordstatus = addslashes($_REQUEST['recordstatus']);
else
   $strRecordstatus = NULL;


//generate sql statement
$SQLstmt = "INSERT INTO slstore VALUES (" .
           "NULL, '$strCompanystoreID', '$strStorename', '$strAddress', '$strCity', " .
           "'$strSuburb', '$strStateID', '$strCountry', '$strZippostcode', '$strTelephone1', " .
           "'$strTelephone2', '$strFax', '$strEmail', '$strWebsite', '$strDescription', " .
           "'$strOpenmonday', '$strClosemonday', '$strOpentuesday', '$strClosetuesday', " .
           "'$strOpenwednesday', '$strClosewednesday', '$strOpenthursday', " .
           "'$strClosethursday', '$strOpenfriday', '$strClosefriday', '$strOpensaturday', " .
           "'$strClosesaturday', '$strOpensunday', '$strClosesunday', '$strOpencloseinfo', " .
           "'$strStoremanager', '$strMaplink', '$strDirections', '$strRecordstatus', " .
           " NULL, '{$_SESSION['username']}', NULL, '{$_SESSION['username']}'" .
")";

// execute statement
if (dbaction($SQLstmt)) 
{

   $from_name = "Book A Party Room Owner";
   $from_email = "sales@bookapartyroom.com";
   $to_email = "sales@bookapartyroom.com";
   $subject = "New Store Submission";
   $message = "Dear Admin: A new store has been submitted to the site with the following information:
               
Book A Party Room Submission Record:
.............................................................................................
               
Party Room Name................$strCompanystoreID
Room Capacity..................$strSuburb
Company Name...................$strStorename 
Party Room Address.............$strAddress
City...........................$strCity
State..........................$strStateID
Zip Code.......................$strZippostcode
Telephone 1....................$strTelephone1
Telephone 2....................$strTelephone2
Fax Number.....................$strFax
Email..........................$strEmail
Website........................$strWebsite

.............................................................................................               

Hosted Occasions...............$strCountry
               
.............................................................................................

Description for Room...........$strDescription

.............................................................................................

Party Room Hours:
...............................$strOpenmonday.....$strClosemonday
...............................$strOpentuesday.....$strClosetuesday
...............................$strOpenwednesday.....$strClosewednesday
...............................$strOpenthursday.....$strClosethursday
...............................$strOpenfriday.....$strClosefriday
...............................$strOpensaturday.....$strClosesaturday
...............................$strOpensunday.....$strClosesunday
  

Other Hours Information........$strOpencloseinfo
.............................................................................................

Manager........................$strStoremanager
Map Link.......................$strMaplink
Directions.....................$strDirections

.............................................................................................

";

   $headers = "From: ".$from_name." <".$from_email.">\r\n";
   $headers .= "Reply-To: ".$from_email."\r\n";

   if(mail($to_email, $subject, $message, $headers, "-f".$from_email));

   print("<P align = right>" . "<a href=\"index.php\">Thank You for Choosing Book A Party Room.com<br>Your Party Room has been Submitted Successfully.</a>");
   //print("<P align = center>" . "<A HREF = login.php>Login Here</A>"
   //print("<div id=\"messagecontainer\">\n");
   //print("<div id=\"userstatus\"><br>Thank You for Choosing Book a Party Room.com<br>Your Number One Source for Scheduling, Locating, and Partying!!<br><br>Your Party Room has been Successfully Submitted to us for review.<br>If you have any questions please email us at<br><br>sales@bookapartyroom.com.<br><br>Thank you again for visiting us!");
   //print("<div id=\"logocontainer\"><div id=\"logo\"><img src=\"images/logo.gif\"></div></div>\n");
   //print("</div>\n");
   
   
   
}

?>

 

Correct me if I am wrong on this, but I think this is the right direction.

Link to comment
Share on other sites

I implemented your change and still have the same result, captcha is not working. If you want I can give you access to the test server... here is the information...

 

address: ftp.byethost16.com

username : b16_3979316

password : homer123

 

The script is located under the store/includes folder.

 

This is not my production server, its just a test one... once this works I will push it up to the domain server.

 

<?php

// ----------------------------------------------------------------------
//   File        : inc_newstore.php
//   Description : displays form to enter a new store record
//   Version     : 1.0
//   Created     : 1/6/2007
//
//   Copyright (c) 2007. All rights reserved.
//
// ----------------------------------------------------------------------

include("inc_security.php");

global $strFormadminstate;

screenheading("New Party Room Submission");

print("<form action=\"{$_SERVER['REQUEST_URI']}\" method=\"post\">\n");
print("<input type=\"hidden\" name=\"pageaction\" value=\"savestore\">\n");
print $strFormadminstate;
print("<table class=\"newtable\" width=\"572\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\n");
print("  <tr>\n");
print("    <td width=\"110\" class=\"newhead\"> Party Room Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"companystoreID\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Room Capacity</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"suburb\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Business Name</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storename\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Address</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"address\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> City</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"city\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> State</td>\n");
print("    <td class=\"newtext\">");

include ("statedropdown.php");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Zip / Post Code</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"zippostcode\" size=\"20\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 1</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone1\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Telephone 2</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"telephone2\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Fax</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"fax\" size=\"30\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Email</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"email\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Website</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"website\" size=\"50\"></td>\n");
print("  </tr>\n");



print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Choose Hosted Occasions </td>\n");
print("    <td class=\"newtext\">");

countrydropdown();

print("</td>\n");


print("  <tr>\n");
print("    <td class=\"newhead\">A Brief Description of Your<br /> Party Room<br /></td>\n");
print("    <td class=\"newtext\"><textarea name=\"description\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onkeydown=\"CheckFieldLength(description, 'charcount1', 'remaining1', 255);\" onmouseout=\"CheckFieldLength(description, 'charcount1', 'remaining1',255);\"></textarea><br>\n");
print("<small><span id=\"charcount1\">0</span> characters entered.   |   <span id=\"remaining1\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Party Room Hours</td>\n");
print("    <td class=\"newtext\">\n");

print("<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\">");
print("  <tr>\n");
print("    <td></td><td class=\"hourshead\">OPEN</td><td class=\"hourshead\">CLOSE</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Monday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openmonday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closemonday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Tuesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opentuesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closetuesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Wednesday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openwednesday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closewednesday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Thursday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openthursday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closethursday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Friday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"openfriday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closefriday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Saturday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensaturday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesaturday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"hoursday\">Sunday</td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"opensunday\" size=\"15\"></td>\n");
print("    <td class=\"hourstext\"><input type=\"text\" name=\"closesunday\" size=\"15\"></td>\n");
print("  </tr>\n");
print("</table>\n");
print("<br>\n");
print("Other hours information<br>\n");
print("<textarea name=\"opencloseinfo\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onkeydown=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2', 255);\" onmouseout=\"CheckFieldLength(opencloseinfo, 'charcount2', 'remaining2',255);\"></textarea><br>\n");
print("<small><span id=\"charcount2\">0</span> characters entered.   |   <span id=\"remaining2\">255</span> characters remaining.</small>\n");
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Manager</td>\n");
print("    <td class=\"newtext\"><input type=\"text\" name=\"storemanager\" size=\"40\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Map Link</td>\n");
print("    <td class=\"newtext\">http:// <input type=\"text\" name=\"maplink\" size=\"50\"></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Directions</td>\n");
print("    <td class=\"newtext\"><textarea name=\"directions\" rows=\"5\" cols=\"40\" onkeyup=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onkeydown=\"CheckFieldLength(directions, 'charcount3', 'remaining3', 255);\" onmouseout=\"CheckFieldLength(direcitons, 'charcount3', 'remaining3',255);\"></textarea><br>\n");
print("<small><span id=\"charcount3\">0</span> characters entered.   |   <span id=\"remaining3\">255</span> characters remaining.</small>\n");
   
print("</td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td class=\"newhead\"> Active</td>\n");
print("    <td class=\"newtext\"><input type=\"checkbox\" name=\"recordstatus\" value=\"active\" checked></td>\n");
print("  </tr>\n");
print("  <tr>\n");
print("    <td> </td>\n");
print("  </tr>\n");
print("</table>\n");


print '<img src="captcha/easycaptcha.php" /><br />
   
   Enter code from above image: 
      <input type="text" name="confirm_code" />';
print("    <td><input type=\"submit\" value=\"Submit\"></td>\n");
if (empty($_REQUEST['confirm_code']))
{
   die("");
}
else
{
   if ( isset($_COOKIE['Captcha']) )
   {
      list($Hash, $Time) = explode('.', $_COOKIE['Captcha']);
      if ( md5("OASDOIJQWOIJDASDOI".$_REQUEST['confirm_code'].$_SERVER['REMOTE_ADDR'].$Time) != $Hash )
      {
         die("Captcha code is wrong.");
      }
      elseif( (time() - 5*60) > $Time)
      {
         die("Captcha code is only valid for 5 minutes.");
      }
   }
   else
   {
      die("No captcha cookie given. Make sure cookies are enabled.");
   }
}

print("</form>\n");
print("<div id=\"bottomspacer\"></div>\n");

Link to comment
Share on other sites

Honestly, I am not worried about that, because this is just a test server and all that data on that server is backed up to my drives, so I am not losing anything. The main domain server is whats important. I can careless if anyone formats, copies, whatever its loose data anyway. Let me know when you have tested this on your end.

Link to comment
Share on other sites

Its working now.. Just needs some formatting on your errors..

Also dont use die.. its not a good way to go..

 

I moved your captcha checking code to the inc_savestore.php page as you said earlier.

I wasnt expecting your code to iterate through the $_REQUEST I was assuming it was using $_GET

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.