Jump to content

mastermike707

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Posts posted by mastermike707

  1. [code]$title = (isset($_POST['title'])) ? strip_tags(htmlentities($_POST['title'])) : false;
    $err = ($title && preg_match("/[A-Za-z0-9]{3, 50}/", $title)) ? '' : "Your title must be at least three characters long and only letters and numbers.<br />\n";
    $author = (isset($_POST['author'])) ? strip_tags(htmlentities($_POST['author'])) : false;
    $err .= ($author && preg_match("/[A-Za-z0-9]{3, 50}/", $author)) ? '' : "Your name must be at least three characters long and only letters and numbers.<br />\n";
    $email = (isset($_POST['email'])) ? strip_tags(htmlentities($_POST['email'])) : false;
    $err .= ($email && preg_match("/[+]@[+]\.[A-Za-z]{2,3}/", $email)) ? '' :"Your e-mail address must be valid.<br />\n";
    $comment = (isset($_POST['comment'])) ? strip_tags(htmlentities($_POST['comment']))  : false;
    $err .= ($comment && strlen($comment) > 3 && strlen($comment) < 500) ? '' :"You must have at least 3 characters in your comment, but not over 500.<br />\n";[/code]
    This code never works correctly, even when the values are correct. Any idea why?
  2. I honestly don't know, I had just never thought about it like that. I guess it would be a little more load, but I think that would outweigh the load of (running, not necesssarily the query) MySQL tho? If I am wrong then just pretend I wasn't in this conversation.
  3. Ok idk what to do, here is the session code I ussually use:
    [code=php:0]class session
    {
    function start($auth = true)
    {
    session_start();

    if(!isset($_SESSION['user_id']) && $auth)
    {
    header('Location: login.php');
    exit;
    }
    $_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
    define('LOGGED_IN', (isset($_SESSION['logged_in'])) ?  $_SESSION['logged_in'] : false);
    }
    function destroy()
    {
    $_SESSION = array();
    session_destroy();
    }
    }[/code]

    Try that and see if it works.
  4. Ok, there is a file that I want to read info from.  Here is an example file:
    [code]
    ## Interface: 11100
    ## Title: MonkeyQuest v2.3.1
    ## Notes: Displays your quests for quick viewing. (http://www.toctastic.net/)
    ## Author: Trentin (trentin@toctastic.net)
    ## SavedVariables: MonkeyQuestConfig
    ## Dependencies: MonkeyLibrary
    ## OptionalDeps: aftt_extreme, BhaldieInfoBar
    MonkeyQuest.xml
    BIB\BIB_MonkeyQuest.xml
    [/code]
    What I want to capture into a variable is:
    [code]MonkeyQuest v2.3.1[/code]
    Now, heres how far I got (dosen't work):
    [code]
    $h2 = fopen('./'.$file.'/'.$file'.toc', 'rb');
    $fd = strpbrk(strrev(substr((fread($h2, filesize('./'.$file.'/'.$file'.toc')), 30)), '';
    fclose($h2);
    [/code]
    (.toc is the file extension) Any help would be appreciated.
  5. Ok, first delete ALL of those recordsets you made, now, make one new recordset, called rs_nav, then select your connection. Now select the nav table. Under columns select all.

    Now insert a repeating region for the nav section, deleting all but one of the 'global links'. make sure that it is a repeating region under server behaviors, and not under templates. Change the text 'global link', and put dynamic text there, making it content, and then select it and change it to a link, now make it a dynamic link by selecting the url field.

     

    EDIT: if thats too complicated, I will make a easier to follow version, (with images).

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.