Hi People; I've got issue in uploading image in cake php. Thing is that, I have a form, where i have input type="file". I need to upload a file in a directory and save its path in database. In "view" its like... <tr><td> <?php echo $this->Form->input('field', array( 'type' => 'file', 'label' => 'Please Upload Signature of Sales Manager' )); ?> </td></tr> and in the "Controller" its like $dir = WWW_ROOT.'documents'; $slas= '\'; $filenamez= $this->data['Invoice']['field']['name']; $dir=$dir.$slas.$filenamez; echo $dir; move_uploaded_file($this->data['Invoice']['field']['tmp_name'],$dir); I'm getting this error.... SQL Query: UPDATE `acm`.`invoices` SET `last_modified` = '2013-06-24 10:10:16', `last_mod_by` = 'Admin User', `invoice_number` = '1306190003', `invoice_date` = …

Member Avatar
Member Avatar
+0 forum 7

0 down vote favorite I have script built with an old version of CakePHP.The script works just fine on live servers but when i tried to install it on my pc (with XAMPP installed) igot problems...I have this error: **Warning: include(cake\bootstrap.php): failed to open stream: No such file or directory in C:\xampp\htdocs\hack\index.php on line 76 Warning: include(): Failed opening 'cake\bootstrap.php' for inclusion (include_path='\C:\xampp\htdocs\hack\cakecore;\C:\xampp\htdocs\hack\cakeapp\;.;C:\xampp\php\PEAR') in C:\xampp\htdocs\hack\index.php on line 76 Fatal error: CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your \cake core directory and your \vendors root directory. in …

Member Avatar
Member Avatar
+0 forum 2

Hello friends, Do you know what is Cake PHP?Is it a tool or a framework? Please let me know your views..... Thanks

Member Avatar
Member Avatar
-2 forum 6

Since I am just experimenting on this, (only localhost) I may like to ask for some ideas(since nothing is really coming out of my mind) about letting a user, who is going to, for example, register to a mini-social-networking site, with a corresponding username/password, personal details, etc. I would upload the image, and save it to a folder, for example '/images/username' and the full path of the folder would be the one inserted to a row named img_dir (of course it is a string, instead of putting it as a BLOB, so later i would just use <img src="path">). I …

Member Avatar
Member Avatar
+0 forum 4

I am trying to populate dropdown list according to other dropdown list using ajax prototype.js framework.But its seems ajax observField function is not picking the change in first dropdown list . I have two tables named mobiles and moddels moddels table has an coloumn mobile_id for association. my models are as follows ***mobile.php*** <? class Mobile extends AppModel { var $name = 'Mobile'; var $hasMany = array('Moddel'); } ?> **moddel.php** <? class Moddel extends AppModel { var $name = 'Moddel'; var $belongsTo = array('Mobile'); } ?> controllers are as follows **moddel_controller.php** <? class ModdelsController extends AppController { var $name = …

Member Avatar
Member Avatar
+1 forum 1

Hi in my form i have an option that i can attach a file to my database and i can see the filename in my database and in my view..but i m trying to make a link on it in view that i can read it please check my code: ***/in add i have this echo $this->Form->input('pod',array('label'=>'Pod attachment','type'=>'file')); **/and here i can browse to a file and attach it **/in the view i m trying this <?php echo $this->Html->link($pod['Pod']['pod']); ?> **/not working i cannot read it any help please

Member Avatar
Member Avatar
+0 forum 5

I'm working on a College Application project. I want to ask on how to download the files that previously uploaded by user. Here's the clear view : 1. User will upload the files. 2. Controller will handle the request and save the name of the files into database. 3. ?? How admin can download the file ??? I try to access the localhost/system/files/upload.doc but doesn't got any luck.

Member Avatar
Member Avatar
+0 forum 1

Heya all, I'm using a special cakePHP plugin for displaying a fully fledged calendar. ([CakePHP full calendar plugin](http://bakery.cakephp.org/articles/silasmontgomery/2011/03/02/cakephp_full_calendar_plugin_2)) By clicking on an appointment in the calendar, the user is redirected to an edit screen, where he or she can change the date, time and a lot of other related data. Now, another function of the calender is to change the date of an appointment by simply dragging and dropping the apointment on a different date (using AJAX). Now the problem i'm having is that, everytime i move an appointment, it opens the edit screen. This is rather annoying when all …

Member Avatar
Member Avatar
+0 forum 5

Hey everyone, I'm learning how to use cakePHP framework. I'm just wondering that how one gets so familiar with a bunch of API's quickly. Do people memorise them at all? I ain't going to because I don't see the point in memorising some things that I even won't need to use ever. What is the best way to go about familairising myself with new API's? Cheers!

Member Avatar
Member Avatar
+0 forum 2

hi guys, i am making a new app in cakephp (and i am new to the framework.. learned how to use it last night).. and i am supposed to make a signup system and login system but i am stuck in the signup. i Worte the models and controllers and even the template for the signup but the system can't save the submitted data: here are the codes.. => Module: (user.php) <?php class User extends AppModel{ var $name = "User"; } => UsersController.php <?php class UsersController extends AppController{ var $name = "Users"; function index(){ $this->set("users", $this->User->find("all")); } function signup(){ if(!empty($this->data)){ …

Member Avatar
Member Avatar
+0 forum 1

Hi everyone, I am looking for an editor or plugin for Komodo or Eclipse that provides me with the CakePHP function autocompletion and syntax correction as well. Thank you all.

Member Avatar
Member Avatar
+0 forum 9

` Error: NotesController could not be found. Error: Create the class NotesController below in file: app\Controller\NotesController.php <?php class NotesController extends AppController { } Notice: If you want to customize this error message, create app\View\Errors\missing_controller.ctp `

Member Avatar
Member Avatar
+0 forum 1

Hi I'm trying to append the content from one of the view file (page.ctp) into another view file (index.ctp). So basically what I'm trying to do is: content from page.ctp ----> index.ctp I managed to get the content of page.ctp using below method. $.get('http://localhost/pages/10', function(data) { console.log(data); }); But based on console.log(data) instead of getting the content of page.ctp, I got the whole page.ctp + default layout. What I want now is to get the content of page.ctp only excluding other default layout file. Hope someone can help me with this. Thank you.

Member Avatar
Member Avatar
+0 forum 2

Hi, this is my first post. I'm new here and also just start playing with CakePHP. And sorry for my English since its not my native language. I had problem to call data from two tables since I dont know how to do it in CakePHP. So basically I doing a simple dictionary that had two tables named users (User) and words (Word). User ------ id username password role created modified nickname Word ------- id word description created modified user_id What I want to do now is to display all the contents in Word table. But instead of display user_id …

Member Avatar
Member Avatar
+0 forum 3

Hi everyone, I'm building a project with CakePHP and I would like to be able to have pages that are created dynamically. So, if a user goes to [url]www.domain.com/page-name[/url], the controller should take the /page-name part of the URL, search the database for it, and then display the results in a specific page. However, I'm unable to get the /page-name part of the URL and pass it to the controller. So far, I have this in my routes.php file: [CODE]Router::connect('/:slug', array('controller' => 'contents', 'action' => 'dynamicpage'), array('slug' => '[a-zA-Z0-9_-]+'));[/CODE] And I have this code in my controller file: [CODE]function dynamicpage($slug) …

Member Avatar
Member Avatar
+0 forum 1

Hi, im making my new CakePHP project and I've got some problems with validating data, which comes from form. I mean i do know how to add custom rule but i don't know how should regex for 9 numeral telephone number looks like. [code] function checkPolishNumber($inputValue){ $regex = 'what to put here?'; if(!empty($inputValue['ask_telefon'])) { return preg_match($regex, $inputValue['ask_telefon']); } else { return true; } } [/code] I think it should let through something like this: +48 111 222 333 111 222 333 111-222-333 111222333 Is it possible to write regex like this? P.S. Sorry for my creepy english. Best regards, Jola

Member Avatar
Member Avatar
+0 forum 2

Hello there.Looks.I want to know how exactly to insert an image from the controller itself. I actually want to use this in my application controller where admin can download user applications. I try to get it done using $this->Html->image() . but it said something about call to a non object bla bla bla.. Anyone can help me? I'm using TCPDF as my PDF writer. Or is it possible to let admin download from the view itself?

Member Avatar
Member Avatar
+0 forum 1

Hi. Anybody dealt with cakephp? I have this problems. The delete function is not functioning. Its not deleting the things I want to delete from the database. Heres my code./ [CODE] function delete($id = NULL){ $this->Application->delete($id); //-->this cause problems $this->Session->setFlash("Application " . $id . " was deleted"); $this->redirect(array('action' => 'index')); } [/CODE] I already try putting the $this->Application->delete($id) in if.. and the if wasnt true.Hence i know its not working. I try to echo the id.. the id is working fine.. Please3 help me.. I'd gone with so many articles on web and nothings seems to help me.

Member Avatar
Member Avatar
+0 forum 1

i'm getting the following errors: Notice 8: Undefined variable: student_info [APP\controllers \motor_developments_controller.php, line 7] i'm getting the same notice in \motor_developments\search.ctp as well. The student_info data in $this->redirect is not getting passed from merry_parents_controller's login function to motor_developments_controller's search function. Does anyone know on why student_info is not getting passed? Any help is much appreciated. merry_parents_controller.php [CODE] function login(){ if ($this->Auth->user()){ //debug($this->Auth->user()); $this->data=$this->Auth->user(); if (!empty($this->data)){ $student_info=$this->MerryParent->Student->find('first',array( 'conditions'=>array( 'Student.merry_parent_id'=>$this->data['MerryParent'] ['id'] ) ) ); echo 'student info: '.$student_info; $this->set('student_info',$student_info); } else{ echo 'Auth user has not been set'; } $this->redirect(array('controller'=>'motor_developments', 'action'=>'search',$student_info)); } } [/CODE] controller:motor_development_controller.php [CODE] <?php class MotorDevelopmentsController extends appController{ public …

Member Avatar
Member Avatar
+0 forum 3

i'm trying to get mongodb to work with cakephp. I'm not sure on where to place ichikaway's mongodb driver for cakephp. The following is my directory structure: under c:/websites/ I have cakephp folder and my project merry_flowers folder. am i supposed to place the mongodb driver in cakephp/app/plugins or merry_flowers/plugins? where am I supposed to add the database connection? in cakephp/app/config/database.php or merry_flowers/config/database.php Any help is much appreciated.

Member Avatar
+0 forum 0

Dear can any body tell me how to configure cakephp with wamp?? i m new in cakePHP. I have already copied cakephp folders/files in wamp's www folder and DocumetRoot "C:\wamp\www\cakephp\app\webroot" Tell me what else have to do.? I am getting a page when clicking on localhost from Wamp but it showing many errors some of that are. Fatal error: Class 'Debugger' not found in C:\wamp\www\cakephp\cake\libs\view\pages\home.ctp Deprecated: Assigning the return value of new by reference is deprecated in C:\wamp\www\cakephp\cake\libs\inflector.php etc.. and also database conection failed

Member Avatar
+0 forum 0

I'm trying to populate the city select box based on the selected state (which is also a select box) using Ajax. When i select state, the city select box is not being populated. There are 5 models below: Student, MerryParent, MerryClass, State, City. All of them are related to one another. Can someone please tell me on what am I doing wrong? thank you. The following are the models: student.php [CODE] <?php class Student extends appModel{ var $name='Student'; var $belongsTo=array('MerryParent','State','City','MerryClass'); } ?>[/CODE] merry_parent.php [CODE]<?php class MerryParent extends appModel{ var $name='MerryParent'; $hasMany=array( 'Student'=>array( 'className'=>'Student', 'foreignKey'=>'merry_parent_id' ) ); $belongsTo=array('State','City','MerryClass'); ?>[/CODE] merry_class.php [CODE]<?php …

Member Avatar
Member Avatar
+0 forum 2

Hi, I'm pretty new to CakePHP, and have been managing so far. I've created a scraper that scrapes TV.com for episode information (episode number, airdate, title, description). The scraper works fine, and returns an array such as: [CODE]Array ( [0] => Array ( [name] => Stowaway [number] => 17 [description] => No synopsis available. Write a synopsis. [date] => 3/18/2011 [show_id] => 11 ) [1] => Array ( [name] => Os [number] => 16 [description] => While Walter attempts to figure out a way to stop the spread of vortexes on This Side, the team investigate a series of thefts …

Member Avatar
Member Avatar
+0 forum 3

I need some help to theme my website a test project to learn cakephp 1.3.4. I have created files for these like default.ctp for website default layout. and home.ctp for home page layout, I try Google for help but there I found nothing a good tutorial for a beginner to help me understand how to use any theme or layout for cakephp website. Can some give a reference link to any material that helps me to understand what exactly I have had to do with cakephp design techniques?

Member Avatar
Member Avatar
+0 forum 1

hiii friends... i m gonna work on modeling ajency based website project. major requirements are: user registration with authentication, their uploads, galleries and ofcource a great search options such as age wise, sex wise. plz tell me what will be the best framework (or cms) i should use. according to me some of the preferable options are: cakephp, codeigniter, symphony or yii. Thanx a lot in advance

Member Avatar
Member Avatar
+0 forum 3

Hello Friends; I am working on a project which is auction site and it is actually clone of [B][url]www.swoop.com[/url][/B] this clone is developed on CakePHP platform and I have a issues there. I purchase that script from [url]http://www.moneymakersnetwork.info/products/Swoopo-Clone-PHP-Script.html[/url] and there is a demo [url]http://demo.bidscout.net[/url] username- demo password= password1 In that cms there is FCKEditor integrated and it is not working. It is gives me that following error massage. [COLOR="Red"]The requested URL /js/fckeditor/editor/fckeditor.html was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.[/COLOR] and if I add …

Member Avatar
+0 forum 0

Hi, how to write the MYSQL Query select count(*) from (SELECT user_id FROM `reports` group by report_id) as tb where tb.user_id=5 in Cakephp inside the Loop [CODE]$users=$this->User->find('all'); foreach($users as & $user): //for each $user['User']['user_id']; which gives the User ids as 1 2 3 4 5 ... endforeach; $this->set('users', $users);[/CODE]

Member Avatar
Member Avatar
+1 forum 2

i am trying to use the File upload feature in my application .. i am having a Form with many fields of type Text,textarea and including File upload FIeld. I have kept a Submit button at the end of the Form which on click will submit the actual value of the textbox /textarea and even the value for the Field of type File upload. [COLOR="Green"] [B]How to get the actual file that is uploaded and to save it in a location so that i can view the uploaded file later on ..[/B][/COLOR] The code that i have used is, [CODE]<form …

Member Avatar
+0 forum 0

Hi, i am trying to use the pagination concept in Cakephp for my application .. [CODE]$allreports=$this->paginate('Report',array('Report.user_id'=>$userId));[/CODE] i am trying to have a group condition in the above query like 'group'=>array("Report.report_id") .. i m not awarre of giving that in this paginate.. where in [CODE] var $paginate = array( 'limit' => 5, 'order' => array( 'Report.report_id' => 'desc' ) );[/CODE] where to place this group condition for the pagination to work..

Member Avatar
+0 forum 0

Hi, i am having a query like [CODE]$report_attrid=$this->Report->find('all',array('conditions'=>array('Report.report_id'=>$report_id,'Report.user_id'=>$userId))); foreach($report_attrid as & $reportattrid): $reportattrid['Report']['attr']=$this->Attribute->find('all',array('fields'=>array('Attribute.id','Attribute.label'),'conditions'=>array('Attribute.id'=>$reportattrid['Report']['attribute_id'],'Attribute.form_id'=>$report_form_id),'order'=>'Attribute.sequence_no')); $reportattrid['Report']['value']=$this->Result->find('all',array('fields'=>array('Result.label','Result.value','Result.submitter_id','Result.submitter'),'conditions'=>array('Result.attribute_id'=>$reportattrid['Report']['attribute_id'],'Result.form_id'=>$report_form_id),'order'=>'Result.id')); endforeach; $this->set('Report_attrid',$report_attrid); [/CODE] 1.the first one for $report_attrid will gives me the all the datas needed for my report as id Report_id title form_id attribute_id 1 1 r1 24 69 2 1 r2 24 72 2.And then foreach attribute_id , i am fetching the Attributes label from my attribute table in the second query $reportattrid['Report']['attr']; 3. And then Foreach Reports attribute_id i am trying to fetch the entries from my results table using $reportattrid['Report']['value'] which gives as At first when attribute_id = 69 it returns 2 …

Member Avatar
Member Avatar
+0 forum 1

The End.