THT Community

Full Version: External login form HOW-TO thanks naven!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok people maybe alot of you have had this problem well i did until lightworkernaven helped me out kudos to her! sorry for the pm's.

Ok First make sure the page your installing the form on is able to call PHP scripts example a regular html page will not call php scripts unless a htaccess workaruond is done. Its usually better to just convert to php any way unless your site has established links all over the net then do the htacess.

Place this just under the <head> tag this little bit is what kept getting me until lightworkernaven stepped in Smile
PHP Code:
<?php define("THT"1);
require_once(
"YOUR_THT_INSTALLATION/csrf-magic.php"); ?>

Ok next place this code were you want your form to appear the code is generic and may need slight tweaking to look right on your site.

PHP Code:
<form id="login" name="login" method="post" action="http://www.YOUR_DOMAIN.com/THT_INSTALLATION/client/"><input type="hidden" name="<?php echo $GLOBALS['csrf']['input-name'] ?>" value="<?php echo csrf_get_tokens() ?>">

    
      <
div align="justify"><span class="h1_text">User Name</span>
        <
input type="text" name="user" id="user" tabindex="1" />
      </
div>
    
<
label>
  <
div align="justify"><span class="h1_text">Password
    
</span>&nbsp;
   <
input type="password" name="pass" id="pass" tabindex="2" />
  </
div>
</
label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Login" />
</
form

PLEASE NOTE THIS IS ONLY TESTED WITH NAVEN'S THT REWORKED 1.3X
NOT SURE ON OTHER OLDER RELEASE'S MAYBE NAVEN HAS MORE KNOWLEDGE AND WILL COMMENT ON THAT Smile