Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by requinix

  1. requinix

    Mouse hover shows text

    The HTML you want looks like CYHZMake sure you have ABBRs styled to give some visual indication that you can hover over them. By default browsers will give a dotted underline and maybe a special mouse cursor (on hover).
  2. requinix

    Remember Passwords in Browser with AJAX form

    Jacques still has a point of trying to make things work without Javascript whenever possible. There are people out there who block all Javascript and have a thing against whitelisting sites. It's not wise to alienate demographics. Anyways. Make your form look like a real form, with a and submit button and all that stuff. Even if its action doesn't go anywhere for now. Then add in an onsubmit handler (for the form or the submit button) that stops the regular action and does the AJAX instead.
  3. requinix

    Remember Passwords in Browser with AJAX form

    What's your form and AJAX code? Are you using an actual submit button with an onsubmit handler?
  4. Because you only got one row. If you want all of them then you need to put the mysql_fetch_assoc() stuff into its own while loop. But that's not very efficient. You could just execute one query to get all the user information for all the friends. SELECT users.user_name, users.user_pic, users.user_id FROM users JOIN friends ON users.user_id = friends.friend_user_id WHERE friends.user_id = that id you have in the sessionOne while loop.
  5. requinix

    Retrieving DISTINCT Records

    Yes. It totally should.
  6. requinix

    Retrieving DISTINCT Records

    The column is propid and it's in the user_assignments table? You don't need to DISTINCT anything. Select from the projects table (the one that has a list of all the projects) then LEFT JOIN it with the assignments table on the matching project ID and the correct user ID, then keep everything that failed to join. SELECT p.id FROM projects p JOIN user_assignments ua ON p.id = ua.propid AND ua.userid = 'abc123' WHERE ua.id /* or another column in that table */ IS NULLIf you're getting poor performance out of the query, that's a different problem... [edit] Above should say LEFT JOIN. Like I did in the description before it.
  7. requinix

    Removing extra periods after sentance

    Probably. What "certain areas"?
  8. requinix

    Commission calculator

    That else you have for the commissionRate stuff? Its closing } is in the wrong place. The indentation is a reminder for it. if ($qtySold >= 100){ $commissionRate = 0.03; }else{ $commissionRate = 0.02; // should go right hereActually what you've described doesn't match up with what the code says, but the brace } thing is a bug. The php.ini. Those two things are settings in the php.ini. You know what, don't worry about it.
  9. requinix

    Stats help plz

    Are you talking about subtraction? $total_visitors = max($visitors_online->count_users() - $online, 0);max() just in case your database disagrees with usersOnline::count_users() about how many people are online.
  10. requinix

    Commission calculator

    Protip: when developing with PHP, make sure you have your environment set up to warn you about potential (or actual) problems. Open your php.ini, then find and change the values for two settings: error_reporting = -1 display_errors = onThen restart your web server. After that, your script should output warnings about how "commissionRate" is undefined. Twice per script, it seems. The problem is that the two lines that try to define it, aren't. ($commissionRate == 0.03);Putting aside how the parentheses are pointless, == is for comparison. You want = for assignment. $commissionRate = 0.03;Change the other one too.
  11. requinix

    a while() within a while()

    If it is doing that then the first query is returning multiple rows. Have you checked that yet?
  12. requinix

    a while() within a while()

    Have you verified that you data reflects what you think is supposed happen? It looks to me like there are three separate calendar entries, each with a different code. And your code shows a "Rank: Code" format that isn't shown in your output. Which does have stray commas in the Duty lines. Ha, ha, "duty".
  13. requinix

    REQUEST_URI for alternate navigation

    Well, what is the value of the REQUEST_URI then?
  14. requinix

    REQUEST_URI for alternate navigation

    The REQUEST_URI will be whatever you see in the browser, not counting the domain name or a #anchor. So are you sure that it should be comparing against "/home.php" and not "/{url}/home.php" (whatever that {url} value may be)?
  15. requinix

    Zip dll

    Is C:\php\ext the right location? Have you restarted your web server since enabling the extension? Checked error logs?
  16. Well, for one, it doesn't match what you described. You said "fun/page/1" but your RewriteRule says "fun/page/stuff/1". And that "stuff" isn't going into the replacement URL so I guess it doesn't matter? Looks like it's supposed to be the search term though?
  17. requinix

    Need help using DateTime Object

    1. echo $date;That's where the problem was. You have to use something like $date->format(...) to get output. 2. Yes, they are predefined.
  18. requinix

    Deleting Cookies

    Also know that you have to match the existing cookie's domain and path parameters. So the checklist is: Calling setcookie() before any output Giving an expiration time in the past (not necessarily a negative number, just something ) Same domain as before Same path as before
  19. requinix

    Best way to store and output arrays as HTML

    So you haven't been able to find a way to insert a
  20. requinix

    preg_replace - How to use variables in your replace string

    Not in the replacement string. If there were $s or \s though, they could cause a problem. It looks fine to me. What are the exact values of $match, $replace, and $content before and after? If you're outputting them to HTML, be sure to look at the actual source of the page and not what your browser's DOM inspection thing may show.
  21. No, the result is "2014-04-2221:02:17". Which should explain why strtotime() couldn't understand it.
  22. requinix

    preg_replace - How to use variables in your replace string

    What is the value of $diagramPath? /e or not won't make a difference because you're doing the replacing just after defining the replacements - the value in $replace would be the same value during the /e execution.
  23. If you got int(0) then the echo did output a 0. Somewhere. By the way, if you didn't notice that code always rounds down the minutes. 1:29 will round to 1:15.
  24. As long as you're using POST and not the URL like in your example, $_POST['POSTDATA'] is a string. That's it. All you have to do is stick it in a file with something like file_put_contents.
  25. requinix

    Are try catch blocks important anymore?

    Exceptions are one way of dealing with problems. If you don't use exceptions then you wouldn't use try/catch. - Exceptions give you a lot of flexibility for dealing with error conditions, but if you don't catch one then your script will crash. - Tracking error codes somewhere (eg, public $errno) are also flexible but if you don't check for them then your application will crash because it doesn't handle error conditions. - Return values are the most common with PHP and force you to handle error conditions, but either they're limited in power or they make your code look crazy because of all the types of things a function can return.

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.