Jump to content

mmosel

Members
  • Posts

    66
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mmosel's Achievements

Member

Member (2/5)

0

Reputation

  1. Oh yes, thank you kenrbnsn - you did give the solution first. I was writing my reply as a you all posted. Thanks to everyone to replied!
  2. Interesting. I've used it for ranges on a few occasions and it works great! I've seen examples of it elsewhere as well. People have posted similar examples on php.net, but it's not an official example. I noticed that on php.net it says switch/case does 'loose comparison', so perhaps that's the answer. When 0, it's probably evaluating to false and causing the problem. I know I can use if else statements. But for a whole boatload of ranges, it's a nice trick to use the switch. It does work, except for the 0 value. Give it a try... ----- update - I like generic's solution - it makes sense since it is simply checking for true or false. I've seen this example on php.net also.
  3. Ok check this out. I've seen this error twice in my code. Is it a bug or am I totally missing something? When I parse the following statement, on both my live and local servers, it echos that $value (when 0 ) is greater than 300. If I switch $value = to 1 then it's fine. So why the problem when = 0? I'm running php 5 on both servers. $value = 0; switch ($value){ case $value < 301: echo "less than 301"; break; case $value > 300: echo "greater than 300"; break; } outputs: greater than 300
  4. Yeah OOP is great, but I'm not so much concerned about our coding style just yet. What I'm thinking about is how to best communicate with a partner about functionality, compatibility, variables, database schema and so forth.
  5. Hello. Been a while since I've been around here! I have a question for some experienced programmers. Up until now, all of my coding has been a one man operation. This is obviously the most efficient way to code in one regard, but it can also take longer. I find myself in a situation where I'm going to be sharing the development of an application, and I'm wondering if people have recommended ways of making collaborations more efficient. My first instinct, going back to early multimedia days, is that a design document is in order. Anyone have any suggestions or links to articles discussing this? I've googled it but nothing jumped out at me. Thanks for any advice.. mmosel
  6. Ok, thanks for the reply, but I'm still not sure how that would work exactly. In terms of storing and retrieving the data for each user and each post and/or thread.
  7. Ok, I'm wondering what is the most efficient way for a forum to keep track of whether or not a member has viewed a thread or not, and that updates when a new post is made in the thread. Seems like a lot of data to keep track of lol. I mean, I could create a table with member ids, thread id and a switch if it's viewed or not. And then everytime a new post is made I'd have to go through and reset the switch for every user and for every thread number. That seems like the table could get pretty massive pretty fast. Had anyone dealt with this or have a clue as to the most efficient way to do it is?
  8. Yeah, thanks for that mr. King. :) I was going to go for the random number, but I decided on auto-increment. I already have a full page_logs table, with ip, user_agent, referer, page, etc. But I want to track repeat visits by guests, and then members who aren't logged in, and then of course while they are logged in. I record raw data, and then run a cron job to filter out bots in the auto-increment table. I'm still working out how I'll process some of the data, but that's another story.
  9. Thanks, but that's a tutorial for who's online. I am building a deeper tracking system that will track return visitors - and using the IP address is not smart for this.
  10. Maybe it's time for a captcha? Either that, or create your own question answer system that stops the bots.
  11. What is your method for tracking guests and returning guests? I'm working on a system where I will set a unique cookie for each guest (or try to). I'm trying to decide if generating a random string is sufficient or if I should use an auto-increment value. If I use the random string, there there is the ever so slight possibility of a duplicate. If I use an auto-increment, then I'm going to have so many non-used numbers it's not even funny (because every time there's a new hit to the home page I would attempt to insert a cookie, which would be an auto increment value). So, how do you or how would you handle this?
  12. [quote author=ShogunWarrior link=topic=100025.msg395472#msg395472 date=1152660622] Except in some browsers ;) [/quote] Really? The base tag doesn't work in all browsers eh? Do you know which ones?
  13. Another tip that I received on another board I visit is a very simple and elegant solution. It doesn't require any special code. Just use the base tag: <base href="http://mydomain.com/" /> And then all of your relative links will magically work as if they were absolute links! Such a simple thing, but it works like a charm. Works for .css, images, and more.
  14. Ok, here's my code! $uri = $_SERVER['REQUEST_URI']; [code] $slashcheck = "\.{1}[a-zA-Z]{3}/+"; $extcheck = "\.{1}[a-zA-Z]{3}"; if (eregi($slashcheck, $uri)){     //echo "slashfound<br />";     $newurl = '/';     $uri = explode('/', $uri);   $count = count($uri); $x = 0; $end = 0;   foreach($uri AS $value){     $x++;     if(!eregi($extcheck, $value) && $value !='' && $end != 1){       $newurl .= $value.'/';       //echo $value." Has has no ext.<br />";     }     if(eregi($extcheck, $value) && $end != 1){         //echo $value." Has an .ext<br />";             $newurl .= $value;                 $end = 1;     }   }//end foreach   echo $newurl."<br />"; } //then of course course redirect to new location... [/code] As an example, $uri = 'index1.php/index2/index3.php/'; returns: index1.php $uri = 'index1php/index2/index3.php/'; returns: index1php/index2/index3.php $uri = 'index1php/index2.php/////index3.php/'; returns: index1php/index2.php
×
×
  • 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.