I have the following JSON: { “nickname”: “xadoc”, “level”: 4, “loc”: “Tulsa, OK, USA”, “score”: 122597, “money”: 29412.5, “streetNum”: 8, “streets”: { “-91607259/387798111”: { …
Invoking a PHP script from a MySQL trigger
Is there any way how to invoke a PHP page / function when a record is inserted to a MySQL database table? We don’t have control over the record insertion procedure. Is there a trigger mechanism which can call a PHP script back? Answer The trigger is executed on the MySQL server, not on the PHP one (even…
secure and resume support file downloading with php
I want to give permission to some of my website users to download a specific file. the download needs to be resume support just for user convenience. For that reason it came to my mind to secure the file with this piece of code: the problem is that not only it’s not resume support also it’s gonno …
How to split a string by multiple delimiters in PHP?
“something here ; and there, oh,that’s all!” I want to split it by ; and , so after processing should get: Answer
Mcrypt installed but doesn’t show up on PHPINFO
I think I managed to install mcrypt lib. The files are in place, but it looks like the library doesn’t run at all. Tried to add: to PHP.INI; no good. Any help? Answer Have you tried restarting Apache? It won’t recognise the new installed module until you do so AFAIK. Also, you’ve written you…
How to define an empty object in PHP
with a new array I do this: Is there a similar syntax for an object Answer A comment in the manual sums it up best: stdClass is the default PHP object. stdClass has no properties, methods or parent. It does not support magic methods, and implements no interfaces. When you cast a scalar or array as Object, you…
How can I see what variables are sent from flash to a PHP script?
I was wondering how I could see what variables my flash sends to my PHP script. Is that possible? Maybe an extension or something else? I don’t know if my flash is sending any variables. My problem is that I have a flash which I can’t change and the flash has a form. In that form the variables are…
.htaccess 301 redirect of single page
After a site redesign, I’ve got a couple of pages that need to be redirected. Everything is staying on the same domain, just a couple of things have been reorganised and/or renamed. They are of the form: /contact.php is now: /contact-us.php Using the .htaccess file, I’ve added this line, which is …
Interview question: In php, is 123==0123?
I have answered it is false. then he asked why? i couldn’t answer. Can anyone make the answer? I am very interested to learn it.
Selecting a single row in MySQL
I am using MySQL, I have a table that has 9 columns. One of them is the primary key. How can I select a single row, by the primary key or column 8 or 4?