cakephp

cakephp 2 css, javascript and links not working on local machine/localhost

不羁的心 提交于 2020-01-24 14:08:17
问题 what htaccess settings should i use on the webroot folder. it seems that it's the primary culprit of why all the links in the Layout doesn't work. here is the htaccess code inside the webroot folder <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> the project is from the live server but i needed to make it work on my local machine/ localhost so that i can make some changes. but as you can

CakePHP form authentication for normal requests with basic authentication for JSON

心已入冬 提交于 2020-01-24 12:33:08
问题 I'm attempting to to build a web application that can be view by a user in a browser but also has an API for developers to interface with my application. My question is how do I change the authentication based on what type of request it is in CakePHP? I would like my application to prompt users using the site with form authentication but when a request comes in with a '.json' to use basic authentication. I've tried this in my AppController: class AppController extends Controller { public

jQuery AJAX call returning 403 Forbidden error when passing Rgraph image data

坚强是说给别人听的谎言 提交于 2020-01-24 02:16:06
问题 I am working on a project, where I have implemented a couple of graphs/charts using the Rgraph PHP library. In my script I do the following for the graphs: Calculate the graph points and draw the graph using the Rgraph Draw() method. Create an image data variable using the canvas.toDataURL() method. Pass this image data variable to the server using jQuery AJAX $.post() method. Save the image to server via the PHP script. Everything in this solution works great on my localhost, however on the

Cakephp 3 Unable to mark multiple checkboxes selected

与世无争的帅哥 提交于 2020-01-23 17:10:27
问题 My Edit view file has a set of checkboxes. I have managed to retrieve the selected checkbox values from the database, and want to mark these as selected in the view file. Edit view file <div class="col-md-12"> <?= $this->Form->label('category','Pick Categories');?> <?= $this->Form->select('category', $options,['multiple'=>'checkbox', 'required'=>'false', 'label'=>'Category','class'=>'col-md-12','selected'=>$catSel]); ?> </div> $options is $options = ['A'=>'Val1', 'B'=>'Val2', 'C'=>'Val3', 'D'

Warnin:Illegal offset type [CORE\Cake\Model\Model.php, line 2734] came on click of login in PHP

余生颓废 提交于 2020-01-23 13:06:48
问题 I created a simple login form using Cake Php.When i click on the Login button one Warning appear Illegal offset type [CORE\Cake\Model\Model.php, line 2734 I have use link as a reference http://bakery.cakephp.org/articles/SeanCallan/2007/04/17/simple-form-authentication-in-1-2-x-x Code of Login.ctp Login <?php echo $this->Form->create('User', array('action' => 'login'));?> <?php echo $this->Form->input('username');?> <?php echo $this->Form->input('password');?> <?php echo $this->Form->submit(

Strict Standards Error in CakePhp?

拜拜、爱过 提交于 2020-01-23 10:48:06
问题 i am using xampp v3.1.0 3.1.0 and cakephp 1.2.10 but I've got these two errors. Strict Standards: Redefining already defined constructor for class Object in E:\xampp\htdocs\projectname\cake\libs\object.php on line 62 Strict Standards: Non-static method Configure::getInstance() should not be called statically in E:\xampp\htdocs\projectname\cake\bootstrap.php on line 46 Thanks in advance 回答1: Seems that old CakePHP doesn't play very well with newer versions of PHP. Please have a look here: http

intl PHP extension is not working for xampp server

余生长醉 提交于 2020-01-23 07:04:09
问题 I am trying to install CakePHP 3-0-0 version and I have downloaded the source code from here. But it is showing the error of enable intl extension . As I have already changed ;extension=php_intl.dll to extension=php_intl.dll (remove the semicolon) in php.ini file and restart xampp 2-3 times, but still it is showing that same error. Here is the error below: Fatal error: You must enable the intl extension to use CakePHP. in D:\xampp\htdocs\cakephp-3-0-0\config\bootstrap.php on line 38 So, can

Cakephp image -Can not determine the mimetype

放肆的年华 提交于 2020-01-23 07:00:27
问题 cakephp 2.3 I'm uploading an image and I have an error saying that: Can not determine the mimetype. Error: An Internal Error Has Occurred. On my Model this is a part of my $validation 'file_name' => array( 'uploadError' => array( 'rule' =>'uploadError', 'message' => 'Your image upload failed', 'allowEmpty' => FALSE, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), 'mimeType' => array(

Timezone and more problems with Cakephp 1.3 and PHP 5.3.2

一个人想着一个人 提交于 2020-01-23 04:26:48
问题 on server i have php 5.3.2, and cakephp 1.3. when i run cakephp application, it gives me following errors: Warning (2): strtotime() [http://php.net/function.strtotime]: It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST

Use domain as “prefix” on CakePHP

不羁岁月 提交于 2020-01-23 02:46:06
问题 Let's say that I have a site running CakePHP and I have the prefix "product". I have lots of pages with URL like: http://mysite.com/produt/blue-shirt/details http://mysite.com/produt/blue-shirt/order http://mysite.com/produt/skate/details http://mysite.com/produt/sun-glasses/vendors Now I need to use a domain like http://mysite-blue-shirt.com/ as "shortcut" to the blue-shirt product, and my URLs will become: http://mysite-blue-shirt.com/details http://mysite-blue-shirt.com/order What I need