Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


kicken last won the day on November 13 2020

kicken had the most liked content!

Community Reputation

570 Excellent

1 Follower

About kicken

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Bonita, FL
  • Age

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Some sort of version control is worth the effort to learn. Git isn't too bad, and is where most things are going these days. There's others available though you could try. I still make heavy use of Subversion and it's fairly easy to use on windows with a tool like TortoiseSVN.
  2. In general and by default https is not required to use sessions. However, your host may have set session.cookie_secure to on in their PHP configuration which would make it so that https is required.
  3. Sounds like you are doing unserialize($data, false); But what you need to do is unserialize($data, ['allowed_classes' => false]);
  4. Nope, polling the process status is what I was speaking of. With proc_open such a thing is possible where as with exec you're just stuck until the process is done. Polling for the status isn't an ideal solution, but it's a solution if that timeout command isn't available (ie, on windows). function run_with_timeout($cmd, $timeout = 30){ $handle = proc_open($cmd, [['pipe', 'r'], STDOUT, STDERR], $pipes); if (!$handle){ throw new \RuntimeException('Unable to launch process'); } fclose($pipes[0]); $start = time(); try { do { usleep(500
  5. The timeout command would be the easiest way to handle this probably. I didn't know that was a thing, good to know. If for some reason that wasn't an option, you should be able to use proc_open and proc_terminate to accomplish the same task. I don't have time ATM to try it and provide an example. If I do later I may post an example.
  6. You can run procedures using either EXEC $sql = "exec exampleProcedure :data"; $stmt = $db->prepare($sql); $stmt->bindValue(':data', $data); $stmt->execute(); or ODBC style CALL $sql = "{call exampleProcedure(:data)}"; $stmt = $db->prepare($sql); $stmt->bindValue(':data', $data); $stmt->execute(); I've done them both ways without issue. The SQLSRV driver by default runs all queries as a prepared query (even when not using ->prepare) which has the effect of isolating state between queries. For example, you can't do something like: $db->query('C
  7. Not really. Think about how much time you're spending now into trying to figure out why your destructor is not being run vs just re-factoring the code to do: $storage->detach($client); $client->cleanup(); My view on the matter is one should for the most part limit destructors to things that are good to do, but don't necessarily need to be done with specific timing/ugency. I rarely ever use a destructor in most of my code. When I do, it's usually for just cleaning up resources (file handles, curl handles, image handles, etc).
  8. Yes, the variables map to the question-mark placeholders. You need one for each question-mark. So when you need to place the same value into a query in different places you need to use multiple ? and bind the variable multiple times accordingly. $stmt2 = $con->prepare("INSERT INTO wp_terms(name, slug) VALUES (concat(?,' ',?), lower(concat(?,'-',?)) ); ^ ^ ^ ^ | | | | +----------+ | |
  9. That's quite the rant there for something that wasn't really ever brought up. Nobody is saying that you need to make your site accept whatever someone whats to throw at it. You can absolutely have your laws/rules about what you will or won't accept. The point of the advice is that you shouldn't try and manipulate someone's input to conform to your rules. Either their input is valid, or it's not. Don't try and "fix it", doing so might just cause you a whole new class of problems. There are numerous cases of people figuring how to craft input such that it would be fine before the filter, b
  10. Your query syntax is wrong. The syntax of an INSERT query is INSERT INTO table (ColumnNameA, ColumnNameB[, ...]) VALUES (ValueOfColumnA, ValueOfColumnB[, ...]) In your prepared query the question-marks represent the values you want to insert into the table. For the column name you currently have some dynamic expression which isn't right. Instead you need the names of the columns into which you want to store the name and slug values.
  11. If you want to track where someone has been on your site and what path the took, the simplest thing to do is just have some code that runs on every request which captures the current page and stores it into the current session. For example $_SESSION['history'][] = $_SERVER['REQUEST_URI']; Make sure you've started the session, either here or elsewhere. Then when you want to that information, such as in your error handler, just read the current $_SESSION['history'] value and it should contain a list of all the URLs they visited in order from oldest to newest. You might want to
  12. There's really only two conditions you need to be concerned with, thus you only need two rewrites. Both of these rewrites should send the user directly to the preferred URL so there's only one redirect. Someone requests the page via http:// Whether they used www or not here isn't relevant, you just redirect them straight to https://www. Someone requests the page via https:// (no-www) Redirect them to https://www. If you're just googling for code to drop in, you might find implementations that chain instead, ie: http://$domain -> https://$domain -> https://www.$doma
  13. This concept has to do with Canonical URLs, you should choose which URL format you want and the redirect everything else to that one format through either your code or server configuration. In simple cases the search engines may figure it out, but it's best if you control the process yourself. There are a number of resources out on the web that can show you how to redirect your requests appropriately for whatever software you're using. For example: Apache force www.
  14. There is a pre-release (5.9.0) that claims support for the 8.0 release candidate, you could try that. Otherwise you'll just have to wait or try building it yourself. I personally don't really plan on doing any PHP 8 work for a while yet.
  • 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.