Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. did you try re-calibrating your battery? There should be an option somewhere on startup to do that. It's a several hour process, as it first dumps all the stored energy from it, then fills it up, then dumps it again, then finally charges it for real.
  2. well unless your openconnection/closeconnection function calls are somehow responsible, there's no way that block of code could unset your session vars. How are you troubleshooting? If you are walking the script through step by step and seeing it disappear in that code block, what line specifically? Is it at the beginning? Or how about this: are your session vars being set inside the if or ifelse condition associated with this else, and therefore they just aren't being set at all if the else is true?
  3. 1) in your loop that displays it, you just use a variable that acts like a switch. Something as simple as this will work: $x = 0; while/for(....) { $color = (($x % 2) == 0)? "#0000FF" : "#00FF00"; $x++; // your stuff to display here: use $color as the color } 2) The short answer is yes. The long answer depends on what you mean by "new comments". Do you mean x amount of newest comments, based on straight last x posts, or all within x time? Do you mean just the very last comment posted? Regardless, your condition would also be inside your loop that displays them. 3) use 1 and 2 to try and work it out. if you're having issues, post what you've tried 4) on your form validation you're checking posted vars right? and if something is missing/wrong, you spit out an error message and display the form again right? If the form is on the same page as the validation, simply use the posted vars as default values in your form elements. On page load, they will either be blank (because first time coming) or filled out with what you had (because you submitted). If it is on a different page, you can use session vars instead.
  4. I don't see any session variables in that code block... are the regular vars you have in that code block being assigned the session info somewhere else?
  5. I guess you didn't use firefox for that post.. Why not? I mean, you never know what interesting ways people will come up with to circumvent your code, so wouldn't having a "catch-all" or "catch-all-the-rest" type thing be the best thing you can have for that?
  6. I thought I just read on their "now hiring" postings they were looking for people heavy into js and ruby?
  7. Anytime I can call out an admin/mod's mistake I'm happy haha hey now admin/mod does not always equal smartest people around... Tell your wife she has a good "i" for detail
  8. oh haha i get it the script does it i guess i should have actually paid more attention my bad.
  9. umm, even if error reporting is on, you won't get mysql_error messages, because it's not an actual error. It just returns false on fail. and anyways, he did post an error msg in the OP so he's got it on on some level.
  10. put ...or die(mysql_error()); after all your mysqli_xxx statements example: $cxn = mysqli_connect ($host,$user,$password) or die(mysql_error()); that should give you some useful information
  11. Cell phones access web pages just the same as laptops, desktops, etc.. the only thing is, you just have to consider is that the user isn't sitting in front of a full size keyboard, mouse and monitor, and also the connection is a lot crappier. So basically you're gonna wanna go as thin as possible on graphics/media, make divs span like 200-300px wide or so max, less making the user have to type stuff in the better, etc...
  12. you have to put session_start(); on every page that wants to use session variables, and it must come before you try to use them.
  13. no, you cannot keep sessions alive after the browser is closed. That's the point of sessions. It's a "session." If you want data persistence beyond sessions, you can look into making a cookie using setcookie(..); and on page load, getcookie and assign the cookie to a session variable or w/e.
  14. mysql_query("update players set message='$message' where ownerid = 1") or die(mysql_error());
  15. well my code didn't actually have tables added into it I was just showing you how to move to another row. Jabop's code shows you that though. Basically you open the table and first row before the loop. Inside the loop, if condition is true, you close the previous row and open a new row. Once the loop is done, you simply close the last row and table.
  16. mysql_query("update players set message='$message' where ownerid = '1'");
  17. assuming $order_details['account_name'] isn't empty, there's nothing wrong with that code. You'll have to post the mail(..) relevant code.
  18. $cols = 1; while (blah) { if ($cols == 5) { echo "<br />"; $cols = 1; } // display image here $cols++; }
  19. http://www.phpfreaks.com/tutorial/debugging-a-beginners-guide
  20. sounds like you possibly didn't escape quotes right or used single quotes around your variable. Using single quotes around a variable causes it to be interpreted literally. You need to post some code.
  21. .josh

    quick

    create a login system and in the user account table have a column that holds the last submitted thing and then when user tries to submit another one, check to see if that time is less than what you want it to be. edit: or actually, I think i misunderstood your question...i really have no idea how the rest of your site is setup, so i couldn't possibly tell you the best/easiest way to do it, but you can do something as simple as $cutoff = 'sometime'; $currenttime = time(); if ($currenttime > $cutoff) { // no submission } else { // submit }
  22. Unless the browser is requesting the page twice, perhaps? Going off that, I'd ask if he is somehow utilizing javascript and maybe it's possibly bugging in IE, causing it to submit twice.
  23. he is using sessions: $userid = $_SESSION['userid'];
  24. The code itself would not cause duplicate entries. But I really don't think it's a browser specific issue either, as the browser doesn't really have anything to do with your code and what it does. I think I would start looking at the code(s) that calls this.
  25. then it gives but it should be like When you presented your problem, I wondered whether or not $str was just an example string representing a 'real' variable input. To that extent, I did know ahead of time that this code would not work in that capacity. But since you didn't mention anything about that, all I could do was assume that that was the exact format of your string. I know that sounds a lot like pointing the finger at you so as to absolve any err on my part, and to an extent it is, but I did disclaim from the get-go that I suck at regex. Though I was sure (as sasa showed us) there was a more elegant solution, you only presented the problem of making "and and and" turn into "and" you did not really explain the full scope of the target string to regex. It is very important to be very specific about the problem at hand, especially when it comes to things like regex. After all, you know how it goes....Garbage In, Garbage Out.
×
×
  • 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.