Jump to content
Larry Ullman's Book Forums

Larry

Administrators
  • Posts

    5413
  • Joined

  • Last visited

  • Days Won

    155

Posts posted by Larry

  1. I'm skeptical about the idea of storing the password and username (i.e., the login info) in a cookie, in a hashed version or not. I'd be inclined to do this... When the user logs in, if the "Remember Me" box is checked, add a random hash to a column in the users table. Then, when they return, the system can check for that stored hash. For added security, you could also store the hash of the username (or whatever) in a cookie, but I wouldn't store the password. You should also salt the hashes, to be safe.

  2. Okay, here's what seemed to work for me. You'll need to tweak it accordingly:

     

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    
    # Add slashes to the end of everything, if not present:
    RewriteCond %{REQUEST_URI} !\.[^./]+$
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ http://localhost/$1/ [R=301,L]
    
    # Redirect about/ and about/X to about.php?get=X:
    RewriteCond %{SCRIPT_FILENAME} !-d  
    RewriteCond %{SCRIPT_FILENAME} !-f   
    RewriteRule ^about/$ about.php 
    RewriteRule ^about/([A-Za-z\+\-]+)/?$ about.php?get=$1  
    </IfModule>

     

     

    Let me know if I missed something or if it's not working. Also, to apply this to multiple scripts, you could do:

     

    
    RewriteRule ^(about)|(contact)|(blog)/$ $1.php 
    
    RewriteRule ^(about)|(contact)|(blog)/([A-Za-z\+\-]+)/?$ $1.php?get=$2
    

     

    That's untested but should work.

  3. I don't think it's possible to set a cookie that never expires. If you set no expiration date, then the cookie only lasts as long as the current browser session. It's just a cookie with a long expiration.

     

    And I agree with Jonathon about the need. I've never felt that they are all that necessary, but some people still expect them, I guess.

  4. That's okay. It's when people post in the forum and then email that's annoying. As for your issue, kudos for validating the XML output. I believe the solution is to change this:

    XMLDataList=event.result.kettle;

    to

    XMLDataList=event.result.kettles.kettle;

    And/or set the showRoot property on the Tree to false. I don't have the time at this moment to test these myself, but I'm fairly sure it's one of those changes that will do the trick.

  5. What you're seeing isn't really a hack attempt in the sense that it's not trying to break your site but rather get those links to be displayed on your site. So, yes, I'd call it random spam. You could choose to ignore it, or if it happens a lot and it bothers you, you could add a check to your contact code that if the contact submission "a href" or "link=", it gets automatically deleted.

  6. As for the second article, I'll start by saying these two articles just remind me that for a while there everyone wanted to make their own framework! My second thought is it's written for PHP 4, so I don't know how useful the actual code will be, considering the serious changes to objects in PHP 5. My third thought is the article is too long to read and review it!

×
×
  • Create New...