Adding Terms of Service checkbox

Hello. I’m trying to get a Terms Of Service Agreement checkbox added to my login page so that someone must check it before they initially login. the page is… I’m not sure what I’m doing wrong because I’m still pretty beginner at php scripting. The sad thing is I can’t even find any files other than .php files for this software I’m using and it’s driving me up the wall trying to figure out what goes where…


<?php $cathead = 0; include('config.php'); session_start(); if (isset($_POST['userid']) && isset($_POST['password'])) { // if the user has just tried to log in $username = $_POST['userid']; $password = $_POST['password']; $query = 'select * from authors ' ."where username ='$username' " ." and password = md5('$password')"; $result = mysql_query($query,$connection) or die(mysql_error()); if (mysql_num_rows($result)) { // if they are in the database register the user id $_SESSION['valid_user'] = $username; } else { header ("Location: login.php?login=failed"); } } if (isset($_SESSION['valid_user'])) { if ($_POST['remember']) { // Set cookie if user checked remember me setcookie("cookname", $username, time()+60*60*24*100, "/"); setcookie("cookpass", md5($password), time()+60*60*24*100, "/"); } header ("Location: author/index.php"); } include('header.php'); include('sidebar.php'); // Setup the login template $logintemp = new Template("templates/".$template."/login.tpl"); $logintemp->set("siteurl", $siteurl); if ($_GET["login"] == "failed") { // if they've tried and failed to log in $logintemp->set("loginerror", '
Incorrect Username or password
'); } else { $logintemp->set("loginerror", ''); } $logintemp->set("captcha", 'require_once(\'recaptchalib.php\'); $publickey = "your_public_key"; // you got this from the signup page echo recaptcha_get_html($publickey);'); if($_GET["account"] == "new") { $logintemp->set("regalert", '
Your Account has been Created. You may login to the left.
'); } else { $logintemp->set("regalert", ''); if($_GET["error"] == "email") { $logintemp->set("regalert", '
That email address is already in use!
'); } if($_GET["error"] == "captcha") { $logintemp->set("regalert", '
ERROR: incorrect verification code
'); } if($_GET["error"] == "user") { $logintemp->set("regalert", '
That username address is already in use!
'); } } // Outputs the template! echo $logintemp->output(); include('obinclude.php'); ?>


Any help you can give at successfully helping me to adding the TOS requirement checkbox to my page will be highly appreciated.

Alright, after fumbling around with it for the last 14 hours, I finally figured it out! This post can be deleted at moderator discretion .

Sponsor our Newsletter | Privacy Policy | Terms of Service