Jump to content

bpops

Members
  • Posts

    232
  • Joined

  • Last visited

    Never

Everything posted by bpops

  1. second problem: I don't believe you need the dollar sign in the $_POST variable: [code=php:0] <?php $ordernum = Trim(stripslashes($_POST['prevwor'])); ?> [/code]
  2. first problem: I don't usually use the mysql_fetch_assoc() function (and truth be told, i dont know what that does)... but I always use mysql_fetch_array()... you could try that and see if it works?
  3. You are creating the cookie before any HTML tags are printed correct?
  4. [quote author=nethnet link=topic=102936.msg409311#msg409311 date=1154661065] $checkname is an array, yet you are treating it as a string in your if statement.  Add a key called 'login' to it. [code]$checkname['login'][/code] [/quote] Hehe I always try to help but I'm never the one who sees the real problem :P
  5. ok so I figured out that this variable returns "Mediapartners-Google/2.1" with Google Ads.. so I suppose I can just ignore all these requests. Thanks so much thorpe, and you too nethnet (from my other post).  You guys have just made me very happy. I've spent hours upon hours this past week trying to figure out why my counter was incrementing more than I was hitting the pages, and now I know how to fix it!!  :)
  6. you also might want to try changing $_POST[recipient] to $_POST['recipient'] i dunno if those quotes matter a whole lot or not.
  7. can you change [code]$checkname = mysql_query("SELECT login FROM clients WHERE login='$_POST[recipient]'"); [/code] to [code]$checkname = mysql_query("SELECT login FROM clients WHERE login='$_POST[recipient]'") or die ("MySQL query error."); [/code] ? That way we know wether or not the query is executing
  8. I'm working on a counter from my site, and the problem I'm having is that the Google ads are checking my page and incrementing the counter. Is there a way to check if the requester is a bot/crawler or a user with a browser? I don't care what the browser is or anything like that, I just don't want bots counting on my counter. Thanks in advance!
  9. True, rather than have someone read all this, ill just lock this one and create a new one
  10. your code seems a bit incomplete.. I see an "else if" but no "if"..
  11. Your first approach sounds the most feasible. The second is defenitely not, since the most frustrating thing about the problem is that it is extremely inconsistent. MOST of the time, the counter works right, then maybe 1 in every 5 times, it increments an extra or TWO. (I have two google ads on each page). But like you said there might be a way of making sure it is a browser looking at the page. There must be a way to do this since many sites do it (as well as trackers), and even phpfreaks here. They have a little counter for each tutorial. That's all I want :)
  12. wow.. as writing my last post I think I figured it out... Google is checking out my page when that ad loads... and they're incrementing the counter, huh? so I guess running the php file separately wouldn't work either.. hmmm.. anyone know how to make it so those google ads won't increment my counter?
  13. Well I don't think you'll believe me if I say my reason, that's why I've been holding back. All week long I've been trying to implement a counter on my website that checks a cookie to see if you're just refreshing or not. (so I'm counting unique views). Well I have this problem that every so often, it increments, then if I check the count later, it has incremented AGAIN by itself (i can actually run a check in php through mysql, use the sleep(3); function, then have it run the same check, and it is different). It's not crawlers, or other users. Ive actually finally figured out what the problem is (though I still have no idea how).. Google Ads. If I remove them, everything works fine. But with them, somehow this mysql query code gets  hijacked. So I want the mysql code in a different file altogether, so theres no chance that the ads disturbs it. I know this sounds crazy, but I've spent hours upon hours with this problem and I'm sure it's the google ads.
  14. I will give this a try, though I don't think this is exactly what I'm looking for. I want to evaluate a separate php file... or maybe I just don't understand this function well enough. thanks for the reply
  15. is there another easy way to do this? I just want [code=php:0] if($var == 1){   //execute some php file somewhere (NOT include it) }else{   //nothing } [/code]
  16. Is there a way to execute a php file from another file? I do NOT want to include it such as in include(whatever.php);, for I believe this would defeat the purpose. Is there a way just to execute another php file for say, running a mysql query (for which I need no returns)? thanks
  17. If you're not seeing anything, my first suggestion would be to change <? to <?php The former is not supported by all installations (or servers) with php. I've seen people on these forums before with this problem. also, with your form, you are doing method="post" and not method="get" right?
  18. That is the method I use on one of my sites, [url=http://www.scriptcrawler.net]http://www.scriptcrawler.net[/url].  If you were looking at all the scripts starting with "a" for example, I select them all, then cycle through them picking out the appropriate ones for each page. I compute the first and last item to pull for each page then display it. My way is a tad complicated though, and I'm not sure if there's a better way.
  19. Yes, it is something I notice while testing. I doubt its a crawler, since I can change the directory name, try it again and the problem persists. And the count only goes up on items I am testing. But the fact that some of you php gurus don't see the bug at least makes me feel better than I'm not just missing something. Perhaps I should just ignore this problem and make the counter live anyway. Thanks for all the help guys. If there are any last suggestions or revelations, feel free to say em :)
  20. thanks luke :) I had modified your code a bit, and now I'm having a new problem.. if  you're interested in taking a look, i Have another post here: [url=http://www.phpfreaks.com/forums/index.php/topic,102741.0.html]http://www.phpfreaks.com/forums/index.php/topic,102741.0.html[/url] But I will try your new code as well and see if for some reason that fixes this strange problem I'm having. thanks!
  21. ober, just so you can see the problem persists, I've changed the code to hits=hits+1. If you guys can't see the problem, would you know of another way of doing this? Or is this the best way of doing a counter? Thanks again :)
  22. [quote author=ryanlwh link=topic=102725.msg408251#msg408251 date=1154540287] bpops, with the category in there, you can't gaurantee the id's will be in CONSECUTIVE orders anymore, so id-3 might not get you anything either... tvdhoff, see my post above yours. [/quote] ah, i see, I didn't understand that before.
  23. Well ryan might have the solution for you up there, but I was thinking you could always do something like [code](SELECT id,title FROM content WHERE id >= ($id-3) and category=$category ORDER BY id DESC LIMIT 6)[/code] which would just get them all.. although I don't know if that's being order the way you want.
  24. [quote author=king arthur link=topic=102741.msg408232#msg408232 date=1154539458] Do you have any traffic at all to your site? Can you check server logs to see if something else has accessed those pages and thereby increased the hit counters? [/quote] I do have plenty of traffic, but it is all to the /wow/ directory. This beta directory I pointed you to is private.. at least in th extent that this is the only place that I've ever posted it. I don't  have site statistic as detailed as to tell me the pages that have been seen, but I'm sure that is not the problem. I've been having this problem since I began doing this counter, when the beta directory wasn't posted even here. Thanks for your reply.
  25. [quote author=ober link=topic=102741.msg408231#msg408231 date=1154539416] Well, you could remove one piece of the puzzle by modifying your SQL: mysql_query("UPDATE wow_items SET hits=hits+1 WHERE id=$id"); That way you do your math based off of what is in the database and not by what junk might be sitting in the $hits variable. [/quote] Thanks for the reply :) I have tried this, and it results in the same problem.
×
×
  • 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.