If I have a string of the following: and when I convert to a DateTime using the following function: it always gives me a DateTime with the time not set. I want to have two DateTime : one marking the beginning of the day, meaning at 00:00:00 another DateTime which is on the same date but at the end of
Project structure for PHP
I am new to PHP and want to know the directory structure for the php projects. I have experience in Java and in java we have src contains java source files, WEB-INF contains lib, and jsp pages. Do we …
JS Equivalent of PHP’s “strtotime(‘-11 month’)”
Is there an simple way to get the date of 11 months ago, in Javascript or even with JQuery involved. Equivalent of using PHP’s strtotime(‘-11 month’). I know you can easily add/substract days in JS’s …
Setting time zone in php
I’m using the following code to get server time. But I’m in Bangladesh and I don’t get Bangladeshi time by this. Please tell me where I have to change for the exact Bangladeshi time. $Vdate=date(“F j,…
Using PDO to CREATE TABLE
I am very new to php and this forum, so please excuse any errors or misplaced questions. In the code i provided, I am just looking to CREATE a Table in the DB “mydb”. I tested the connection to the DB(It works). It is just the creating the table i am having issues with. Any advice or criticisms wo…
Gettext will always use system default locale
I need to localise a Windows-only PHP web application and I’m evaluating the gettext extension but I’m having the hardest time trying to make it work in my Windows 7 development box. I’ve used trial and error together with Process Monitor to overcome the poor and inaccurate documentation and…
cakephp shopping cart default admin password
Thanks for reading my post. I planned to create online shopping cart website. so i plan to look at the cakephp shopping cart plugin(due to is awesome). but i like to know the default admin password …
PHPExcel: Download the Excel file on the client side
The problem was solved: For other users that may have this problem – notice the encoding of the PHP file. If you use PHPExcel it must be ANSII encoding and not UTF8, otherwise the EXCEL will be downloaded corruptly. The Headers that were added (answer 1) solved the problem after i changed the encoding o…
Creating a very simple 1 username/password login in php
I want to make a single login for just 1 user without storing in a database but I can’t seem to get this to work. My code: login.php trylog.php Answer Your code could look more like: Now, when the page is redirected based on the header(‘LOCATION:wherever.php), put session_start() at the top of the…
Differentiate each apache user and give permissions
In a web application, I want to create a folder for each www-data user and give write permissions just on that folder, and just to that user. AFTER VALIDATION I can do: This will create a new directory with a random name, in the path $file->getPath() with all permissions to the owner user. But it would giv…