If you are working on a small project and no one has the time to go in and resize all images to fit a specified area, I have a quick fix for you. This fix only works when the specified area is restricted by either height or width: img {width: 180px; height: *%; }. This […]
Category: PHP Development
Hey everyone. I’m looking for a solution that will allow mp3s to play from a private directory below the public_html directory. For instance, all my mp3s are in the “/home/user/private/” directory while my web-files reside in “/home/user/public_html/”. The problem with this setup is that the client side needs a client path: “www.iaps.ca/private”, but since the
When using the mysqli_bind_params() function, you may want to consider listing int parameters as strings if the number may be greater than the maximum allowed value for an int. For Example: If you specify type “i” (integer), the maximum value it allows you to have is 2^32-1 or 2147483647. So, if you are using UNSIGNED
If any of you developers are having issues uploading files, remember to ensure enctype=”multipart/form-data” is an attribute of your form declaration: … FacebookTwitterPinterestDiggitEmailPrint
Having issues with $_SESSION[‘var’]’s not being saved after you redirect the user via header()? Add exit(); after the header() call. Example: $_SESSION[’emailed’] = true; header(‘Location: response.php’); exit(); Cheers! FacebookTwitterPinterestDiggitEmailPrint
We’ve tried many different methods to set precision for a number variable (specifically a currency amount) and we’d like to share the best method we’ve found: number_format( {number}, {precision}, ‘decimal_separator’, ‘1000s_separator’ ); Example: number_format( $number, 2, ‘.’, ‘,’ ); Hope this helps! We have also tried using round( $number, {precision} ) but it ignores zeros(0)