Jump to content

kicken

Gurus
  • Posts

    4,704
  • Joined

  • Last visited

  • Days Won

    179

Everything posted by kicken

  1. It sounds to me like what you want is basically the output generated by the XDebug Profiler. It will give you a file containing the line #'s, functions called, and timing data. You can then take that and generate your pretty-picture showing what happened (or just use one of the already existing tools for that).
  2. Use the browser's Network debug tools (or an external tool like Fiddler2) to check the Set-cookie: header that is sent. If the browsers are rejecting the cookies even though their settings should be allowing them, then perhaps the parameters of the Set-Cookie header are invalid (bad domain, incorrect path, etc). If they are invalid, then check your php.ini settings and correct them. I've also heard before (but don't know if it's fact) that some browsers will not accept cookies from domains with invalid characters (ie, domains with an _) or no dots (ie, localhost). So if you are just using http://localhost/ to access the site, the browser may drop the cookie due to no dots in the domain 'localhost'. If you are just using localhost, edit your hosts file (and possibly apache config) to add a domain with a dot and then use that instead. I usually setup a domain like site.local for all my development sites, where site is the name of (or abbrivation of) the website.
  3. Check your browsers to make sure they are configured to allow cookies. If they are rejecting the session id cookie then each page load will be starting a new session. One way to check whether you are getting a new session or not is to echo the result of session_id. If it changes on each load then you're getting a new session each time.
  4. You don't need to be calling mysqli_close yourself, PHP will take care of that cleanup when your script ends. You should only be opening your connection once during your script so make sure that you are doing that. If it's just you browsing the site, then you really should only be seeing a couple of connections at most. The next questions though would be whether you are using shared hosting or dedicated hosting. If it's shared hosting, those graphs you see may not be just you, and might include other uses on that system. I'm not familiar enough with PHPMyAdmin or Hostgator to know what exactly those graphs measure.
  5. It'd help if you actually defined what happens rather than just say it doesn't work. Do you get any errors? Does anything show at all or just a blank page? If the status.txt file doesn't exist, does it get created? If you want help, you need to provide details, not just say it doesn't work.
  6. Are you talking about just traffic between your Database server and webserver, and not traffic from external sources like people browsing the site or a crawler of yours downloading the news? Either way really, for something that is "just development/testing stage" I would be inclined to believe that no, you should not really see that much traffic. Without knowing more about the situation though it's hard to say for sure.
  7. The procedural functions are just small wrappers basically, eg: function mysqli_query($obj, $query){ return $obj->query($query); }
  8. That should be: public function __construct($isbn) There are supposed to be two underscores in front.
  9. The plugin in question would have to provide you with some means of interacting with it, such as exporting a JS API or intercepting certain URL types. Without that, there isn't much you can do.
  10. Don't print the message from within the loop. Just set a variable (ie, $found) to true if the letter is found within the word. After the loop, check if $found is true or false and print the appropriate message. $found=false; //Assuming not found for ($i=0; $i<$letterCount; $i++){ if (...){ $found=true; } } if ($found) { print 'Correct'; } else { print 'Oops'; }
  11. It'd probably be better if you tried to explain more about what you are trying to accomplish and why. An insert could take a little time so depending on how fast you need them to process, yes you may have issues with latency. The second part of your question is pretty much impossible to answer without knowing more about your overall goals. This sounds like more of a PHP/General programming question that a Mysql question too, probably should be in another forum but not sure which one yet, need more info.
  12. HTTP Authentication with PHP
  13. I had thought I read somewhere that MySQL did reuse space on inserts. A little digging around in the manual revealed: So it seems it does.
  14. Yes, if you click a link then your browser resolve the domain using it's DNS settings. This is basically what I suggested to you, include a JS file which will show a success message if the browser successfully resolves the domain and loads it. Your original post was about having PHP try and check the DNS which means it would be using the server's DNS not the clients. The OpenDNS Test Page does something similar, but more sophisticated from what I can tell. They have two IP's that map to the www.opendns.com domain (xx.218 and xx.219). The xx.218 IP seems to be the IP they publish to the global internet, while the xx.219 IP is published by their DNS system. On the server end they can check which IP a user connected to and use that to determine if they configured their settings properly or not. You don't even need a registered domain to do the JS test I was talking about. You'd just setup your DNS server with a zone for some special domain, such as test.fakedomain and have it resolve to an IP. You can configure your DNS servers to respond to any domain, there is no need for them be registered or even use one of the established TLDs.
  15. Anything you do on the server end is going to use your server's DNS settings, not the client's. What you'd need to do is use Javascript to make a request for some domain which would only resolve with your custom dns. Have a simple webserver running for that domain to serve up a JS file or image or something. For example, you could serve up a JS file like: document.getElementById('results').innerHTML = 'Success!'; clearTimeout(timer); Then in your test page do something like: <div id="results">Testing...</div> <script type="text/javascript"> var timer = setTimeout(function(){ document.getElementById('results').innerHTML = 'Failed!'; }, 6000); </script> <script type="text/javascript" src="http://test.fakedomain/test.js"></script> That will show a Testing message to the user, and set a timer so that after 6 seconds it will consider the request failed and show that. If the DNS is setup correctly, then test.fakedomain will resolve and the above script will run changing the message to Success and canceling the timer.
  16. You need to add a WHERE clause to your SELECT statements that limit it to only pulling rows associated with a particular account. In addition, when looping the results for the transactions you need to either output the records during the loop or store them into an array so that you get all transactions rather than just the last one.
  17. You forgot a ; at the end of line 4
  18. PHP has a function for that: escapeshellarg
  19. ::1 is the IPv6 version of 127.0.0.1. The output is perfectly valid.
  20. var_dump is a function for debugging what a variable contains. What you've been asked to do is add a line of code which uses var dump to show you what $balance contains. Add the line of code you were given after line 88 and let us know what the output is.
  21. Depending on what $json contains before you decode it, your $json_decoded may be an object not an array. If you want it to use associative arrays rather than objects then you need to pass true as the second parameter to json_decode.
  22. Your remember me checkbox should just set a cookie with a random token in it, nothing else. Then you add some code to your script which will check if that cookie exists and if so, verify the token against the database. If the token is valid then you pre-load the necessary $_SESSION variables from the database.
  23. You're calling msql_query and msql_error rather than mysql_query and mysql_error. Also, you should post your own topics, not revive an old thread.
  24. kicken

    ID to GUID

    GUID values have to be quoted in the query like strings. You'll also want to run it through mysql_real_escape_string before using it in your query.
×
×
  • 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.