Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. Two ways. DNS has a value called the TTL (Time to live) that is associated with a domain. This tells server that they should cache the DNS entry for that domain once they read it. Big ISP's may be even more aggressive and just ignore the TTL altogether and cache it for a week. Often the default TTL for many domains quite long. Secondly the workstations themselves depending on the operating system will cache DNS for domains they've visited, and they may never pick up the right DNS information without a reboot. Keep in mind that if for example, someone used a DNS server that let's say had cached information for your domain from the 17, with a long TTL, any clients which go through that DNS server will not be getting the new information. If this is a website, it's always good to put in a redirect on the server to the new server to catch people who have the old information until such time as everything is sorted out.
  2. Actually, I think it needs to be LIMIT 13, 1 if you literally want the 14th row.
  3. The rank and file php programmer who only does small sites might not use memcache, but for larger sites, it's heavily used. It's also extremely simple, consisting aside from connections of literally two functions... set() and get(). Set is pretty much set('key', 'value') where typically a key might be something like: '/foo/bar/something/'. In other words the structure of the key can be whatever you want, but it's vital that the routine that tries the get() has a matching key, or you may end up looking for cache entries that are there, but never get found because of some problem in the way the key was generated. You could probably do some analysis yourself and look for the memcache routines in the code you have. Good luck.
  4. You're better off then, posting pieces of those, and asking for help in filling in missing gaps. For example, I assume in your code objRS is a row you've read from a database. Are you asking for help on how to select from a database, and if so, which one? I tihnk from the information I provided you, you should be able to translate that code into something similar, since all you're doing is getting some data from a form, comparing it to a row that was read from the db into an object, and setting some session variables.
  5. I'm not going to translate code for you, sorry. I will pick out a few things that you can study yourself. Data from a form comes in via one of the PHP superglobal arrays. If the method of the form was post, in the target script you have access to the form elements values via $_POST['txtPassword'] as one example. Session variables can be set and read via the $_SESSION[] superglobal. If you have specific questions I don't mind looking at them, but our goal here is to help developers learn PHP themselves. As an ASP dev, you should find many of the basic strategies and concepts to be the same, but you still need to invest time in learning how PHP and mysql works.
  6. PHP has a similar session system. sessions Redirection is trivial: header
  7. gizmola

    Help

    Here is what you do: -Find the code you added -Remove it.
  8. When you do session_start() people get a session id. That is not enough. When the user completes the login process, then you should set a session variable. Frequently, people will set it to be the user table id, or something similar. Checking for the existence of that variable is a good way to insure that people are actually logged in.
  9. If items aren't being evicted, then the cache is not filled. So the answer seems to be that whatever routines are adding items to the cache, and checking the cache are not finding a match in the cache 60% of the time.
  10. In other words, you would like to have spaghetti code. I'm not sure what you are aiming for or why, but I can tell you without a doubt that the approach you are taking is the wrong one.
  11. If you don' t have a commercial virtualization product, you can use virtualbox.
  12. Very easy to do: http://www.youtube.com/watch?v=Ef1RxtTwbO4
  13. If the two servers can talk to each other over the intranet, there should be no problem. "APPSERVER" really has no meaning. You need to be more specific.
  14. I"m not sure what type of feedback you're looking for. Usually people use memcache to cache database query results in memory. Url's sound like a small set of data, so it's hard to understand why the cache hit rate wouldn't be higher over time.
  15. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=331852.0
  16. There are numerous ways to handle this. One very nice way is to create a unique constraint or index in the database that will disallow duplicates. I like this type of approach because it puts the rule in the database, and makes it impossible for the rule to be subverted.
  17. You'll need to code up a javascript function that implements your confirmation. Here's one that uses the built-in javascript confirm() dialog. function confirmBox(msg, target) { if (confirm(msg)) { window.location=target; } } And you'd use it like so: click Me
  18. Here you go. Note several things--- -- first you must pass event when you associate the event handler in your onClick(). Make sure you notice that I altered what you had to do this, with the button element. -- For this to work with IE AND FF, you can't use value for a variable in a button form element due to the fact that IE sets the value of the button to be whatever is between here. So in FF, you will get the value of the value attribute, but IE basically ignores this. Name= is honored by both, so you might want to forget about value, and set name= to be the value you actually want to return. This is what I did for this demonstration. Ultimately that is not a problem of the code, but a cross browser compatibility issue. function insert(e) { var event = e || window.event; var target = event.target || event.srcElement; // checking browser if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); }else { xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById('message').innerHTML = xmlhttp.responseText; } } // passing data to php parameters = 'text='+target.name; alert(parameters); //xmlhttp.open('POST','update.inc.php','true'); //xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded'); //xmlhttp.send(parameters); } wtf
  19. I just showed you how to get the value inside the insert function. What is it that you don't understand?
  20. Don't post the same question multiple times. I answered the question in the other thread. http://www.phpfreaks.com/forums/index.php?topic=331809.0
  21. The value of an html element is something you get from the DOM. It's not related to CSS properties or names. Since you have a generic function, what you want is to have that function utilize the event and determine which element the event is tied to. Inside your insert() function there should be something like this: insert(e) { var event = e || window.event; var target = event.target || event.srcElement; // now check target.value. } Try that and see how it works 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.