Jump to content

Captcha Code - Easy Fix I am Sure


winuser2003

Recommended Posts

Okay, go to the main site..

 

http://www.bookapartyroom.com

 

Click Submit A Party Room

 

Scroll Down and try and input the code, everything is hyperlinked for some reason, I have had this issue before but cannot remember right off where I fixed it. Here is the code I implemented that came from you.

 

<?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");
print("</form>\n");
print("<div id=\"bottomspacer\"></div>\n");

 

Why would everything hyperlink like that?

Link to comment
Share on other sites

I viewed your source code and you are missing some closing </a> tags somewhere in your document.

<div id="pageheader">
  <div id="logocontainer"><div id="logo"><img src="images/logo.gif"></div></div>

<div id="mainmenu">
<div id="menuoptions">
    <div class="menuoption"><a href="">    <div class="menuoption"><a href=""></div>
<div id="userstatus"></div>
</div>
</div>

Link to comment
Share on other sites

Thank you so much for all your help, I am sorry if I upset you earlier and thank you for being patient with me. I can catch something quick, somethings come a little longer than others. The obvious apparently does not slap me until its too late. Thank you again for all your help.

 

-J

Link to comment
Share on other sites

Thanks for the understanding and sorry for the frustration. I am wondering where a hyperlink is coming from though. Lets say you go to the site and click on Submit a Party room. Put in something like test and scroll all the way down. Enter nothing in the captcha and click submit. You get the message correctly, however the message is also hyperlinked back to the administration area where I do not want people at. How would i remove this link??

Link to comment
Share on other sites

You found the code here in the common.php file I noticed, correct me if I am wrong. I am looking through it a bit and I will let you know when I cannot find anything that will help the link I am trying to remove. This will take a little time and hope I do find it. Here is the common.php file code...

 

<?php

// ----------------------------------------------------------------------
//   File        : common.php
//   Description : common functions used in printing HTML screens and
//                 state management
//   Version     : 1.0
//   Created     : 1/6/2007
//
//   Copyright (c) 2007. All rights reserved.
//
// ----------------------------------------------------------------------




// ----------------------------------------------------------------------
//   Function    : pagestart()
//   Description : prints the beginning of a HTML page to the browser
//   Usage       : pagestart()
//
// ----------------------------------------------------------------------

function pagestart() {

   global $ApplicationName;

   print("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
   print("<html>\n");
   print("<head>\n");
   print("  <title>$ApplicationName</title>\n");
   print("  <link rel=stylesheet href=\"administration.css\" type=\"text/css\">\n");

   //only reference char count javascript for the new store and edit store screens
   if (isset($_REQUEST['pageaction'])) {
      if ($_REQUEST['pageaction'] == "newstore" || $_REQUEST['pageaction'] == "editstore") {
         print("  <script type=\"text/javascript\" src=\"charcount.js\"></script>\n");
      }
   }

   print("</head>\n");
   print("<body");
   if (isset($_REQUEST['pageaction']))
   {
      if ($_REQUEST['pageaction'] == "editstore")
      {
         print(" onload=\"CheckFieldLengthsOnEdit()\"");
      }
   }
   print(">\n");

}




// ----------------------------------------------------------------------
//   Function    : pageend()
//   Description : prints the end of a HTML page to the web browser
//   Usage       : pageend()
//
// ----------------------------------------------------------------------

function pageend() {

   print("</body>\n");
   print("</html>\n");

}




// ----------------------------------------------------------------------
//   Function    : startpagecontainer()
//   Description : prints the start of a division which acts as a 
//                 container for all other pages elements
//   Usage       : startpagecontainer()
//
// ----------------------------------------------------------------------

function startpagecontainer() {

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

}




// ----------------------------------------------------------------------
//   Function    : pageheader()
//   Description : prints a page header within the page container
//   Usage       : pageheader()
//
// ----------------------------------------------------------------------

function pageheader() {

global $SetConsole;
global $consolelink;

   if (isset($SetConsole))
   {
      //for future console controlling many applications
      if ($SetConsole=="ON") 
         print("  <div id=\"console\"><a href=\"$consolelink\">Return to console</a></div>\n");
   }

   print("<div id=\"pageheader\">\n");
   
   print("  <div id=\"logocontainer\"><div id=\"logo\"><img src=\"images/logo.gif\"></div></div>\n");
   

}




// ----------------------------------------------------------------------
//   Function    : startpagecontent()
//   Description : prints the start of a division for the main content
//   Usage       : startpagecontent()
//
// ----------------------------------------------------------------------

function startpagecontent() {
   
   print("<div id=\"pagecontent\">\n");

}




// ----------------------------------------------------------------------
//   Function    : mainmenu()
//   Description : prints the main menu 
//   Usage       : mainmenu()
//
// ----------------------------------------------------------------------

function mainmenu() {

   global $SetConsole;
   global $strAdminstate;

   print("<div id=\"mainmenu\">\n");
   print("<div id=\"menuoptions\">\n");

   print("    <div class=\"menuoption\"><a href=\"");
   if ($_SESSION['area']=="store")
      print $strAdminstate;
   print("\">");
   //if ($_SESSION['area']=="store")
   //   print("<img src=\"images/storeonbutton.gif\" border=\"0\">");
   //else
  //    print("<img src=\"images/storeoffbutton.gif\" border=\"0\">");
  // print("</a></div>\n");

   //Only let administrator and superusers access the user and state sections.
   //Further security is included in the pages contained in these sections.
   if ($_SESSION['accesslevel']=="Super" || $_SESSION['accesslevel']=="Administrator")
   {

      print("    <div class=\"menuoption\"><a href=\"");
      if ($_SESSION['area']=="state")
         print $strAdminstate;
      print("\">");
      //if ($_SESSION['area']=="state")
      //   print("<img src=\"images/stateonbutton.gif\" border=\"0\">");
     // else
     //    print("<img src=\"images/stateoffbutton.gif\" border=\"0\">");
     // print("</a></div>\n");


      if ($SetConsole != "OFF")
      {
         print("    <div class=\"menuoption\"><a href=\"");
         if ($_SESSION['area']=="user")
            print $strAdminstate;
         print("\">");
        // if ($_SESSION['area']=="user")
         //   print("<img src=\"images/useronbutton.gif\" border=\"0\">");
         //else
         //   print("<img src=\"images/useroffbutton.gif\" border=\"0\">");
         //print("</a></div>\n");
      }

   }

   print("</div>\n"); // end menu options div

   print("<div id=\"userstatus\">");
   if ($SetConsole != "OFF")
      print("");
   print("</div>\n");

   print("</div>\n"); // end main menu div

   print("</div>\n"); // end pageheader div

}




// ----------------------------------------------------------------------
//   Function    : endpagecontent()
//   Description : closes page content div
//   Usage       : endpagecontent()
//
// ----------------------------------------------------------------------

function endpagecontent() {

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

}




// ----------------------------------------------------------------------
//   Function    : endpagecontainer()
//   Description : prints the end of a division which acts as a
//                 container for all other page elements
//   Usage       : endpagecontainer()
//
// ----------------------------------------------------------------------

function endpagecontainer() {

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

}




// ----------------------------------------------------------------------
//   Function    : screenheading()
//   Description : prints a heading in the content area
//   Usage       : screenheading($strHeading)
//   Arguments   : $strHeading - text to display in heading
//
// ----------------------------------------------------------------------

function screenheading($strHeading) {

   print("<div id=\"screenheading\">$strSub</div>\n"); 

}




// ----------------------------------------------------------------------
//   Function    : display_paged_navigation
//   Description : diplays the page navigation links when a search 
//                 result has more than 1 page of records
//   Usage       : displaypagednavigation($intTotalpages,$intPage)
//   Arguments   : $intTotalpages -  total number of results found during
//                 the search
//                 $intPage - the current page identifier
//
// ----------------------------------------------------------------------

function display_paged_navigation($intTotalpages,$intPage) {

   global $intChaptersize;   // how many pages per chapter - see settings.php
   global $strNavadminstate;

   // only show page navigation links if number of pages > 1
   if ($intTotalpages > 1)
   {

      // calculate current chapter based on current page
      if (fmod($intPage, $intChaptersize) == 0)
         $intChapter = ($intPage/$intChaptersize);
      else
         $intChapter = ceil($intPage/$intChaptersize); 

      // display paged record navigation bar
      print("<div id=\"pagenavcontainer\">\n"); 
      print("<div id=\"pagenavigation\">\n");

      // display previous chapter link if it exists
      if ($intChapter > 1)
      {
         print("<div id=\"pagenavprev\">"); 
         print("<a href=\"{$_SERVER['PHP_SELF']}$strNavadminstate&pn=" . ((($intChapter-1)*$intChaptersize)-$intChaptersize+1) . "");
         print("\">Prev $intChaptersize pages</a>");
         print("</div>");
      }

      // display page links
      $intStartat = (($intChapter*$intChaptersize) - ($intChaptersize - 1));
      //print("startat: $intStartat<br>");

      if ($intTotalpages < ($intChapter*$intChaptersize))
         $intFinishat = $intTotalpages;
      else
         $intFinishat = ($intChapter*$intChaptersize);
      //print("finishat: $intFinishat<br>");

      for($x=$intStartat;$x<=$intFinishat;$x++)
      {
         if ($intPage == $x)
         {
            print("    <div class=\"pagenavbox\">[$x]</div>\n");
         }
         else 
         {
            print("    <div class=\"pagenavbox\"><a href=\"{$_SERVER['PHP_SELF']}$strNavadminstate&pn=$x");
            print("\">$x</a></div>\n");
         }
      }
        
      // display next chapter link if it exists
      if (($intChapter * $intChaptersize) < $intTotalpages) {
         print("<div id=\"pagenavnext\">");
         print("<a href=\"{$_SERVER['PHP_SELF']}$strNavadminstate&pn=" . (($intChapter*$intChaptersize)+1) . "");
         print("\">Next $intChaptersize pages</a>");
         print("</div>");
      }

      print("</div>\n"); // end pagenavigation div
      print("</div>\n"); // end pagenavcontainer div

   } // end if total pages > 0


}




// ----------------------------------------------------------------------
//   Function    : printmessage()
//   Description : prints a message box in the content area
//   Usage       : printmessage($strMessage)
//   Arguments   : $strMessage - text message to display in box
//
// ----------------------------------------------------------------------

function printmessage($strMessage) {

   print("<div id=\"adminmessage\">\n");
   print("<div id=\"adminmessagetext\">$strMessage</div>\n");
   print("</div>\n");

}




// ----------------------------------------------------------------------
//   Function    : printconfirmmessage
//   Description : prints an action message with options to confirm or
//                 cancel
//   Usage       : printconfirmmessage($strMessage,$strConfirmlink,
//                 $strCancellink)
//   Arguments   : $strMessage - message to print
//                 $strConfirmlink - link with address of page to go to
//                  if you want to confirm the action
//                 $strCancellink - link that takes you back if you
//                  elect to cancel action
//
// ----------------------------------------------------------------------

function printconfirmmessage($strMessage,$strConfirmlink,$strCancellink) {

   global $strAdminstate;

   print("<div id=\"adminmessage\">\n");
   print("<div id=\"confirmmessagetext\">$strMessage</div>");
   print("<div id=\"confirmmessagelinks\"><a href=\"$strConfirmlink\">Yes</a>     <a href=\"$strCancellink\">Cancel</a></div>\n");
   print("</div>\n");   

}




// ----------------------------------------------------------------------
//   Function    : get_admin_state
//   Description : return part of a querystring which can be added to
//                 links to maintain search state, or return the same
//                 information in hidden form elements
//   Usage       : get_admin_state($intMode)
//   Arguments   : $intMode -  identifies whether to return querystring
//                             components for general or page navigation
//                             links, or whether to return hidden form
//                             elements
//
// ----------------------------------------------------------------------

function get_admin_state($intMode) {

   global $setdebug;
   global $strLastrec;


   $strAdminstate = "";
   $strAdminstatelastrec = "";
   $strNavadminstate = "";
   $strFormadminstate = "";


   if (isset($_REQUEST['key']))
   {
      if ($_REQUEST['key'] != "")
      { 
         $strAdminstate .= "&key=" . urlencode($_REQUEST['key']);
         $strFormadminstate  .= "<input type=\"hidden\" name=\"key\" value=\"" . urldecode(urlencode($_REQUEST['key'])) ."\">";
      }
   }


   if (isset($_REQUEST['pageaction']))
   {
      //changes pageaction variable the when you first login to help build page navigation
      if ($_REQUEST['pageaction'] == "checklogindetails")
      {
         $tmppageaction = "storelist";
      }
      else
      {
         $tmppageaction = $_REQUEST['pageaction'];
      }

      $strNavadminstate = "?pageaction=" . $tmppageaction . $strAdminstate;
   }

   //generate a second admin state variable for use in confirm delete to avoid showing
   //a page which doesn't exist anymore because the last row on that page has just been
   //deleted
   $strAdminstatelastrec = $strAdminstate;

   if (isset($_REQUEST['pn']))
   {
      $strAdminstate .= "&pn=" . $_REQUEST['pn'];
      if ($strLastrec == "true")
      {
         $tmppn = $_REQUEST['pn'];
         $tmppn--;
         $strAdminstatelastrec .= "&pn=$tmppn";
      }
      else
      {
         $strAdminstatelastrec = $strAdminstate;
      }
      $strFormadminstate .= "<input type=\"hidden\" name=\"pn\" value=\"" . $_REQUEST['pn'] . "\">";
   }


   //return result based on $intMode supplied
   if ($intMode == 0)
   {
      //pass back querystring version of current state
      return $strAdminstate;
   }
   else if ($intMode == 1)
   {
      //pass back querystring version of current state for navigation links
      return $strNavadminstate;  
   }
   else if ($intMode == 2)
   {
      //pass back hidden form variable version of current state
      return $strFormadminstate;
   }
   else if ($intMode == 3)
   {
      //pass modified admin state string for use when last row on a page is deleted
      return $strAdminstatelastrec;
   }

}




?>

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.