Jump to content

ManiacDan

Staff Alumni
  • Posts

    2,604
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by ManiacDan

  1. I assume "install Ubuntu" isn't a good idea then? PrintScr copies the screen to the clipboard. Why not open photoshop/gimp/photoimpact/whatever and just paste into there instead of paint?
  2. Are you trying to do this on a timer? If so, various malware and spyware does this.
  3. Oh geeze, I thought the errors weren't showing at all. your errors are an array. echo implode("<br />", $_SESSION['errors']);
  4. Put session_start before ob_start
  5. ...are HTML files being parsed as PHP on your system?
  6. Wherever you put it, there needed to be a space.
  7. Are you calling session_start() at the top of every page?
  8. You're redefining $r inside your loop. This is why you need to use descriptive variable names.
  9. | is a vertical pipe. Put a space in here: echo '<u>|</u>'
  10. There's no whitespace in your output, so the browser cannot break because this is one long word. Put a single space after your vertical pipe, and it will work fine.
  11. preg_match_all('#<TR[^>]*><TD>([^<]+)</TD><TD>([^<]+)</TD><TD>([^<]+)</TD><TD>([^<]+)</TD><TD>([^<]+)</TD><TD>([^<]+)</TD></TR>#', $thisText, $foo); $foo will be a multidimensional array with foo[0] being all the rows, and then foo[1]-[6] being each column, in order, with the header in the first slot. so $foo[3][0] is 'Dep', and $foo[3][1] is STN. You could also use the DomDocument on this, but the documentation is terrible.
  12. This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=358236.0
  13. This is not at all a PHP question, so I'm moving it to the HTML/CSS section. Reply to this and paste the resulting HTML of this output, along with relevant CSS. The PHP loop probably works fine, but none of this HTML is styled (and there's no div at all) so we need to see the actual HTML output.
  14. You should always actually echo mysql_error() to read the error message. Your problem is that at least one (maybe two) of your column names on that table are reserves mysql keywords. Enclose column names in `backticks` to avoid this error. Probably, I mean, I don't have your database or anything other than a single comment saying a single query has failed.
  15. Josh, is your regex faster than mine? Just wondering. Conditional regexes have always thrown me, despite being an 'expert' otherwise.
  16. You could also have added the ID as a hidden form element, so that it would be available in POST
  17. Ok, the error is in your takedamage function, and nowhere else. You need to debug just this function. Your code has no error handling or even any concept that something could go wrong, so debugging is going to be difficult. First, dump the SELECT and UPDATE statements to the screen before they're called. Then, add output for mysql_error() after every mysql_query command. You should be adding error-handling code to all of these queries, especially if you're a new developer. It should be something like: $rs = mysql_query($sql); if ( !$rs ) { echo "ERROR IN QUERY: <br /><i>{$sql}</i><br />Mysql Returned: " . mysql_error() . "<P />"; } $row = mysql_fetch_array($rs);//or whatever, proceed with your code.
  18. This is the perfect way to debug on your own. How are you sure $_POST is set? Did you print_r it? There are 4 redirects in this code snippet, did you figure out which one is the culprit? Insert die() statements before each redirect to identify which one it is. Once you find it, var_dump all the variables that lead to that logical condition, and ensure they are what you expect them to be. If one (or more) of them is not, move up in the code until you identify the fault. This is far too much code which relies on page load effects and external files for us to find it by hand.
  19. When confronted with a problem like this, it's often a good idea to take a step back and ask WHY you only want one hyphen. What purpose does that serve? However, this regex solves your issue without asking why: /(^-[a-z]+$)|(^[a-z]+-[a-z]+$)|(^[a-z]-$)/ Also, in the future, please describe the whole problem. Xyph answered your question in its entirety, and then you came back and said "that's a good start, now here's two more rules."
  20. Thank you for coming back and posting the answer. The boards tend to get low traffic on the weekends. Next time your thread is solved, you can click the "mark solved" button along the top or bottom to mark it as such. I've already marked this one for you. Come back if you need more help!
  21. If there's no match, $result will still be an object. You need to be using mysql_num_rows here. Also, your passwords don't appear to be encrypted.
  22. You shouldn't be storing data like this. You should have: CONTINENT ------------- CONTINENT_ID NAME COUNTRY ------------- COUNTRY_ID CONTINENT_ID NAME That way, you don't have delimited strings in your database (which is [almost] always wrong) and you'll be able to do real queries on this data. Then, your inserts would be easier too, without having to use implode().
  23. The political discussion that had started in this thread is now split into its own thread. Please use this thread to discuss domain registrars and web hosts only.
  24. A fox news reader!? GET HIM!
×
×
  • 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.