Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    The captcha is not getting enabled

    Hello,

    It seems a wonderful forum

    have used a captcha

    Code:
    <!--box start-->
    <tr>
    	<td height="40">
    <div class="common-box-left">Security Code*</div>
    <label id="security_code" for="security_code">
    </label>
    	</td>
      	<td>
            <input type="text" name="security_code" id="security_code" lass="text-area" lang="MUST" title="Security Code" />
            &nbsp;<img name="image_scode" id="image_scode" src="CaptchaSecurityImages.php?width=100&amp;height=40&amp;characters=5" width="70" height="21" align="absmiddle" /><a href="javascript:void(0);" class="links" onClick="document.image_scode.src='CaptchaSecurityImages.php?width=100&amp;height=40&amp;characters=6&amp;'+Math.random();return false"> &nbsp; <font color="#000000">Reload Image</font></a> </div>
        </td>
        <!--box end-->

    However, the validation is not happening, when we attempt to made changes
    Code:
    function register_save()
    	{
    		global $mainframe;
    
    		// Check for request forgeries
    		JRequest::checkToken() or jexit( 'Invalid Token' );
    
    session_start();
            $post = JRequest::get( 'post' );
            if(($_SESSION['security_code'] == $post['security_code']) && (!empty($_SESSION['security_code'])) ) 
            {
            $newUsertype = $usersConfig->get( 'new_usertype' );
            if (!$newUsertype) 
                {
                $newUsertype = 'Registered'; 
                }
            unset($_SESSION['security_code']);
            } 
    
    
            if($_SESSION['security_code'] != $post['security_code'] || $post['security_code']=="")
            {
                JError::raiseWarning('', JText::_( $user->getError()));
                $this->register();
                return false;
            }
    
    		// Get required system objects
    		$user 		= clone(JFactory::getUser());
    		$pathway 	=& $mainframe->getPathway();
    		$config		=& JFactory::getConfig();
    		$authorize	=& JFactory::getACL();
    		$document   =& JFactory::getDocument();
    
    		// If user registration is not allowed, show 403 not authorized.
    		$usersConfig = &JComponentHelper::getParams( 'com_users' );
    		if ($usersConfig->get('allowUserRegistration') == '0') {
    			JError::raiseError( 403, JText::_( 'Access Forbidden' ));
    			return;
    		}
    
    		// Initialize new usertype setting
    		$newUsertype = $usersConfig->get( 'new_usertype' );
    		if (!$newUsertype) {
    			$newUsertype = 'Registered';
    		}
    
    		// Bind the post array to the user object
    		if (!$user->bind( JRequest::get('post'), 'usertype' )) {
    			JError::raiseError( 500, $user->getError());
    		}
    
    		// Set some initial user values
    		$user->set('id', 0);
    		$user->set('usertype', $newUsertype);
    		$user->set('gid', $authorize->get_group_id( '', $newUsertype, 'ARO' ));
    
    		$date =& JFactory::getDate();
    		$user->set('registerDate', $date->toMySQL());
    
    		// If user activation is turned on, we need to set the activation information
    		$useractivation = $usersConfig->get( 'useractivation' );
    		if ($useractivation == '1')
    		{
    			jimport('joomla.user.helper');
    			$user->set('activation', JUtility::getHash( JUserHelper::genRandomPassword()) );
    			$user->set('block', '1');
    		}
    
    		// If there was an error with registration, set the message and display form
    		if ( !$user->save() )
    		{
    			JError::raiseWarning('', JText::_( $user->getError()));
    			$this->register();
    			return false;
    		}
    
    		// Send registration confirmation mail
    		$password = JRequest::getString('password', '', 'post', JREQUEST_ALLOWRAW);
    		$password = preg_replace('/[\x00-\x1F\x7F]/', '', $password); //Disallow control chars in the email
    		UserController::_sendMail($user, $password);
    
    		// Everything went fine, set relevant message depending upon user activation state and display message
    		if ( $useractivation == 1 ) {
    			$message  = JText::_( 'REG_COMPLETE_ACTIVATE' );
    		} else {
    			$message = JText::_( 'REG_COMPLETE' );
    		}
    
    		$this->setRedirect('https://www.2checkout.com/checkout/spurchase?sid=1689498&product_id=2&quantity=1', $message);
    	}


    the session code is added in register_save for validating the captcha its showing server error - Server error The website encountered an error while retrieving mycarhelpline.com/…. It may be down for maintenance or configured incorrectly. Here are some suggestions: Reload this webpage later. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

    what to do - pl help

  • #2
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can some one help to de-bug the error with solution pl

  • #3
    New to the CF scene
    Join Date
    Sep 2012
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any one can help on it pl !!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •