I did a series of research on this topic, but unfortunately I couldn’t find a perfect way to encrypt and decrypt files in PHP. Which mean what I’m trying to do is find some way to encrypt & decrypt my items without worry of cracker knew my algorithm. If some algorithm that need to secrete &…
How does while ($row = $result->fetch_object()) work? [closed]
I was watching a tutorial series on PHP MySQLi this morning and I came across a bit of code that the author of the series didn’t bother explain. I have seen this code before but never knew exactly how …
php date validation
Im trying to to set up a php date validation (MM/DD/YYYY) but I’m having issues. Here is a sample of what I got: Answer You could use checkdate. For example, something like this: A more paranoid approach, that doesn’t blindly believe the input:
Ajax request is canceling other JS events on page
I have a table that is populated with results of an AJAX onchange request. Everything works perfectly, but I also have an included JS script that is loaded on window.load which changes the table based …
PHP – Unzip and convert images from .jpg to .bmp
I’ve a code that unzip files that I upload to my server, it works without any problem. But now I want to add another function. I want to convert all images that are in .zip file (.zip file only contains images) from .jpg format to .bmp. There is some easy way to do it? If there is not, at least
Create cpanel database through php script
Im trying to automate the installation of some custom software using cpanel/whm and postwwwacct php script.This requires files to be copied to the users public_html folder then edit the config and set eh file permissions. So far so good, no issues. When trying to create the database im running into some probl…
Why does ‘Cannot break/continue 1 level’ comes in PHP?
I am getting sometimes this error on production at: I have tried to reproduce this issue. But not getting any progress. $Id, $Properties having value received. Does anyone know when does ‘Cannot break/continue 1 level’ comes in PHP? I have seen this post PHP Fatal error: Cannot break/continue. But…
Are there more advantages to returning an empty string or null value?
If I were writing the below method (for example) is it considered good practice to either: A: return an empty string if the document didn’t exist? B: return a null value? Having done a lot of Java, and methods in Java requiring a return type, I’m under the impression it is best practice to return …
How to use ‘interval’ in Doctrine2 Query Builder
In my Symfony2 repository, I’d like to get objects from a schedule table, that have started, but not finished yet. The interval, within the objects should be encountered as ‘not finished’, should be passed as a variable. Using plain SQL, it works like this: Can I achieve the same with DQL / …
How can I change opencart order email content as our wish? Is it possible?
Can I change the content of order email, which file it exactly refers? This is a confirmation of an online transaction placed with ######. The AuthOnly transaction totaled $171.90 and will be …