We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32269
    • 6 Posts
    Hey Folks,

    I happen to have the same problem with captchas..

    Here some details i figured out.

    Using 0.9.2

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /dead.at/web/manager/includes/veriword.php on line 81
    
    Warning: Cannot modify header information - headers already sent by (output started at /dead.at/web/manager/includes/veriword.php:81) in /dead.at/web/manager/includes/veriword.php on line 68
    ÿØÿà
    [... Starting of the Jpeg-Image ...]


    I fixed it quite easily..

    I added the following since the functions uses it even if its not available.

    global $dbase, $database_server, $database_user, $database_password, $table_prefix;

    	function pick_word() {
    		global $dbase, $database_server, $database_user, $database_password, $table_prefix;
    		// set default words
    		$words="MODx,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote";
    		// connect to the database
    		if(@$dbConn = mysql_connect($database_server, $database_user, $database_password)) {
    			mysql_select_db($dbase);
    			$sql = "SELECT * FROM $dbase.".$table_prefix."system_settings WHERE setting_name='captcha_words'";
    			$rs = mysql_query($sql);
    			$limit = mysql_num_rows($rs);
    			if($limit==1) {
    				$row = mysql_fetch_assoc($rs);
    				$words = $row['setting_value'];
    			}
    		}
    		$arr_words = explode(",", $words);
    		/* pick one randomly for text verification */
    		return sprintf("%s",$arr_words[array_rand($arr_words)].rand(10,90));
    	}	



    HTH

    Regards.
      • 10326
      • 6 Posts
      Quote from: Djamoer at Mar 06, 2006, 03:46 PM

      Quote from: bugaev at Mar 06, 2006, 03:09 PM

      shocked shocked shocked
      I’ve turned on Captcha validation, but the code picture is not displaying. So, I even can’t login the manager now! And how can I turn off it in order to login the back-office?

      Please help me!

      I have to pass the almost ready site to client and I can’t!

      lol, grin
      I can understand your frustration.
      Do you have phpMyAdmin ready for your database administration purposes? If yes, go to modx table, and look for "prefix_system_settings" table
      Inside it, look for "use_captcha" under "Setting_name" column. Yours suppose to have 1 as the value, so you need to set it back to 0.

      After that, browse through your cache folder, and backup all the files in there, in case something goes wrong. After backing up all the files, clean the folder, and copy all the files located in original MODx distribution package to the cache folder on your site.

      Try it out, hope that helps.



      Hi, i know this topic is old, but it is exactly the same problem as i have (captcha not working, so can’t login to manager anymore), so i did as you said (set the use_captha to 0, and empty the /assets/cache folder and copy files from original distribution to cache folder). I didn’t had the original package on my pc anymore, so i looked up in the database which version i had: 0.9.5. Next i downloaded the 0.9.5. package from modxcms.com and copied the contents of the cache folder to the same folder on the webserver. When i go to the manager loginpage, i get the following error:
      Warning: fopen(/home/bla/domains/mysite.nl/public_html/modx/manager/media/style//login.html): failed to open stream: No such file or directory in /home/bla/domains/mysite.nl/public_html/modx/manager/includes/accesscontrol.inc.php on line 85
      
      Warning: filesize(): Stat failed for /home/bla/domains/mysite.nl/public_html/modx/manager/media/style//login.html (errno=2 - No such file or directory) in /home/bla/domains/mysite.nl/public_html/modx/manager/includes/accesscontrol.inc.php on line 86
      
      Warning: fread(): supplied argument is not a valid stream resource in /home/bla/domains/mysite.nl/public_html/modx/manager/includes/accesscontrol.inc.php on line 86
      
      Warning: fclose(): supplied argument is not a valid stream resource in /home/bla/domains/mysite.nl/public_html/modx/manager/includes/accesscontrol.inc.php on line 87


      When searching on the forum, i read somewhere to CHMOD the cache files to 777. Unfortunately this doesn’t solve the problem. Can somebody please help me, because just like the topicstarter the site is finished, captcha was the last thing to do!

      Gladly i backed up the cachefiles first as recommended! laugh
        • 32269
        • 6 Posts
        Quote from: fuut at Mar 11, 2007, 04:59 PM


        Hi, i know this topic is old, but it is exactly the same problem as i have (captcha not working, so can’t login to manager anymore), so i did as you said (set the use_captha to 0, and empty the /assets/cache folder and copy files from original distribution to cache folder). I didn’t had the original package on my pc anymore, so i looked up in the database which version i had: 0.9.5. Next i downloaded the 0.9.5. package from modxcms.com and copied the contents of the cache folder to the same folder on the webserver. When i go to the manager loginpage, i get the following error:
        Warning: fopen(/home/bla/domains/mysite.nl/public_html/modx/manager/media/style//login.html): failed to open stream: No such file or directory in /home/bla/domains/mysite.nl/public_html/modx/manager/includes/accesscontrol.inc.php on line 85
        
        Warning: filesize(): Stat failed for /home/bla/domains/mysite.nl/public_html/modx/manager/media/style//login.html (errno=2 - No such file or directory) in /home/bla/domains/mysite.nl/public_html/modx/manager/includes/accesscontrol.inc.php on line 86
        
        Warning: fread(): supplied argument is not a valid stream resource in /home/bla/domains/mysite.nl/public_html/modx/manager/includes/accesscontrol.inc.php on line 86
        
        Warning: fclose(): supplied argument is not a valid stream resource in /home/bla/domains/mysite.nl/public_html/modx/manager/includes/accesscontrol.inc.php on line 87


        When searching on the forum, i read somewhere to CHMOD the cache files to 777. Unfortunately this doesn’t solve the problem. Can somebody please help me, because just like the topicstarter the site is finished, captcha was the last thing to do!

        Gladly i backed up the cachefiles first as recommended! laugh

        Does the file: " /home/bla/domains/mysite.nl/public_html/modx/manager/media/style//login.html " actualy exist, and has the correct permissions set?


        Regards
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          No, it does not... note the // after the /style part of the path. This is another case of the missing default MODx style. That should be /style/MODxLight/...
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 33337
            • 3,975 Posts
            This is very old topic and related to v0.9.2.

            Closing this topic. If you need more help please start a new topic in appropriate forum.

            regards.
              Zaigham R - MODX Professional | Skype | Email | Twitter

              Digging the interwebs for #MODX gems and bringing it to you. modx.link

            This discussion is closed to further replies. Keep calm and carry on.