1 Reply Latest reply on Oct 7, 2010 7:21 PM by Günter Schenk

    ADDT Captcha not working with Friendly URLS

    Joseph07888 Level 1

      Hi All,

       

      I am planning on abandending the re-captcha option due to its stupidity!

       

      I am going back to the trusty ADDT Captcha but it will not work with friendly mod_rewite URLs.

       

      It does work with dynamic URL's fine

       

      The code

      Without mod_rewrite (MODR) just using dynamic URLs

       

      [<img src="<?php echo $captcha_id_obj->getImageURL("../");?>" border="1" />]

       

      It will display and work as it should

       

       

      With mod_rewrite (MODR) nice friendly URL's (I edited the getImageURL to releative path adding a "/" at the beginning.

       

      [<img src="<?php echo $captcha_id_obj->getImageURL("/../");?>" border="1" />]

       

      Displays fine but will not validate

       

      When choosing the Dynamic option for testing the image does not display at all.

       

      Users have the option to enter a memorable word for their friendly URL, if they don't it defaults to the dynamic option.

       

      Event bookers have the option to register / book to attend the event without been a member of the network.

       

      Has anyone got any suggestions?

       

      If you need more info please let me know.

       

      Cheers,

      Joe

        • 1. Re: ADDT Captcha not working with Friendly URLS
          Günter Schenk Level 4

          Hi Joe,

           

          ADDT (and its directory/files structure within the "includes" directory) doesn´t have a clue about the "friendly URL" rules you defined in your .htaccess file and has not been designed to account for such a "virtual directory" scenario, so it´s to be expected that those components which rely on e.g. grabbing a captcha image from a given "includes" directory or even loading "dependant" PHP files like those which define the validation rules might fail to work.

           

          Joseph07888 wrote:

           

          With mod_rewrite (MODR) nice friendly URL's (I edited the getImageURL to releative path adding a "/" at the beginning.

           

          [<img src="<?php echo $captcha_id_obj->getImageURL("/../");?>" border="1" />]

           

          Displays fine but will not validate

          In this case you might have succeeded by bringing this relative path into line with the "virtual directory" rule (say: example.com/subfolder/pagename.html) under which the current page gets placed -- but this doesn´t mean that other ADDT files are getting loaded as well, and I think the main issue is, that other parts of your PHP document can´t find the "includes" folder.

           

          What I´d try to do, is:

           

          1. If you *know* that the current page will always be loaded from the same virtual directory hierarchie, try adjusting all ADDT page code which points to the "includes" folder by prepending the same "/../" fake path segment.

           

          2. Make sure that the "includes" folder and all of its subdirectories are getting excluded from the rewrite rules

           

          Hope this helps ;-)

           

          Cheers,

          Günter