Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. How is your table structured? I don't see why you aren't just ordering it by the 'last update' column? May also help if you post your query..
  2. How many sites are you talking?
  3. You're not explaining your problem clearly. "ORDER BY" simply orders the results of a query by a particular column(s), it cannot be used to determine if a column 'exists' or not; even though you should know if a column doesn't exist.
  4. Could be many things. Do you have a link to a page we can test it (and user / pass if needed)?
  5. No, not quite. Are you implementing your own custom sessions here? If not and you're just using standard PHP sessions you don't need to worry about any of this. Just call session_start and PHP will handle the rest - remember to call session_start() on any page you need sessions though.
  6. Is the code run on separate requests? Sounds like you may want to look into session variables.
  7. I'm not sure what you mean by Firefox doing it automatically. The PHP configuration primarily controls how the session ID is stored. It's using a cookie by default, but you can change the setting to have the session id automatically appended to every link instead. If you use standard PHP sessions, you don't need to worry about session hi-jacking. PHP prevents that. If you create your own custom sessions, then as mentioned before, not just relying on the cookie to be correct and validating the user is who they say they are.
  8. What do you mean by it can't echo? I'm guessing the two snippets are actually in opposite order to this within the file?
  9. Sorry I was just referring to the 'remember me' cookie; naming it a token... As in it grants you token access. It's a fairly common name for things like that.
  10. KingPhilip is insinuating those 3 software packages are the cause of your problem, since they have bad reputations for various reasons.
  11. Not if you implement a few checks to ensure you have the correct user.. like validating the token as well as the user's IP for example.
  12. Sorry yeah, I see what you mean. Would a simple map table like this not do the trick..? verbal_id | product_id | state_id | profession_id | verbal_str 1 | 1 | 4 | 2 | 'Text for your example' Although thinking about it, performance would probably be better (and you'd be able to make the column unique) to join the various IDs within a single key: verbal_id | verbal_key | verbal_str 1 | '1:4:2' | 'Text for your example' But I guess it depends in what ways you'd be using the data.
  13. First of all cookies should never be used to store important/private data, nor be trusted. A user can easily modify a cookie to anything they want. If you store usernames in them, all the user would have to do is modify their cookie and they can be any user they wish. Really the only time you should use cookies is to store non-private/insecure data, like for example page references, 'remember' tokens that are validated server-side, session IDs, etc. PHP sessions on the other hand are stored on the server and cannot be manipulated by the user. A session ID is automatically generated and stored within the user's cookies to link the user to the session. This isn't "trusted" however - additional checks are done to verify the user hasn't just stolen somebody else's session ID. You can store private data (to a degree) in these relatively securely. Of course if there's a major security hole in your system then the data may be compromised.
  14. Can you explain how verbiage applies to this exactly? Don't really understand what you're trying to do.
  15. Sorry that's a bit misleading.. PHP automatically applies urldecode() to $_GET and $_REQUEST - the browser has nothing to do with it.
  16. Oh I see what you mean, like random numbers instead of multiples? The problem with that is the plug-in has been written to use a pattern. You'd need to rewrite parts of the plug-in yourself, which definitely won't be easy if you're new to JavaScript.
  17. Depends on the situation. Normally, the browser will transform it to the right value for you though.
  18. You need to encode the ampersand and semi-colon, as within URLs they are used to separate parameters. The PHP function urlencode will come in useful for you here.
  19. You can use JavaScript: var updateInterval; window.onload = function() { updateInterval = setInterval(updateText, 60000) // once a minute } function updateText() { var txt = // method of getting text document.getElementById('updateMe').innerHTML = txt; } The element that will contain the text needs defining: <span id="updateMe">Update me...</span> Populate the initial text normally to prevent users with JS disabled missing out. You'll notice I haven't actually written the AJAX request; you're better off reading up on AJAX first and understanding what it is and how it works, before you start using it. However I've given you the basic structure for your code which should allow you do make a start... All you need to do is submit a HTTP request either to the flat file containing the text, or a PHP script that will return the text for you. There's a lot of online resources that should be able to help you with that part.
  20. Actually if a password hasn't been set you don't *need* to pass the third parameter, unless you've set a default in the php.ini configuration file. First get the form working through the normal submission method, to ensure once you add in the extra "AJAX" functionality you don't make it unusable for those with JavaScript disabled.
  21. What were you struggling with? If you post your problematic code I'm sure we'll be able to get it working.
  22. You could use call_user_func_array to pass a dynamic array of parameters to the function.
  23. 'onclick' suggests you mean to submit the data without the page actually navigating away from the page. Is that what you're trying to describe?
  24. Use usort to define a function that will perform the sorting logic: function sortByAge($a, $b){ if ($a['age'] == $b['age']) { return 0; } return ($a['age'] < $b['age']) ? -1 : 1;}usort($users, 'sortByAge');
×
×
  • 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.