groupon clone

2011-04-29 Thread newguy
Hey guys
Recently I have been give a groupon clone to work with as a part of
school assignment, problem is I dont know how to host it on my MAMP
server. I downloaded the whole source code folder in my htdocs but
when I try to access file through browser(example home.php) the
browser either doesnt show anything or it downloads the file.

My question is how can I make this site run locally on my machine.(I
have the DB configured and installed locally).

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Facebook like notification

2011-03-06 Thread newguy
Hi
I have a admin section and a user section in my website, I want to
give admin the option that when he enters a note in a particular table
and selects that this note should be available to the user then on the
user side user should be able to see some sort of alert stating that
admin wants the user to see a note and on clicking that alert teh user
is able to see that particular note.

Any suggestions how to implement this???

I thought that when ever "body" column for that user in this table is
not null we generate a alert on the user side(every user has a unique
id and there is a separate table for storing these notes, this table
has a column named "body"), if this is a decent way can anyone please
help in how to implement this.

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Problem with accessing form data

2011-02-22 Thread newguy
Hi
I have a simple form in my view where the user enters a 4 digit
numeral code, in the controller action am unable to access this code,
it would be great if some one could tell me how to access this code in
the action and then pass this code as a parameter to another
controller action.

***Form**
Enter User Code
Create('Admin',array('action'=>'view_specific'));
  echo $form->input('Code');
  echo $form->end('Submit');
?>


*Action
function view_specific()
 {
if($this->data)
 {
// $code=get data from teh form;


//$this->redirect(array('action'=>'view_specific_result',
$code));


 }
 }


Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Still stuck with Media View some one please help!!!

2011-02-05 Thread newguy
I have a display page with follwoing 4 links:

Select the game to download

link('Game 1',array('action'=>'download')); ?>
link('Game 2',array('action'=>'download1')); ?>
link('Game 3',array('action'=>'download1')); ?>
Game 4


On clicking each link a different file should be downloaded.

I am using Media View to dlownload file placed on my disk but since
the file name is hardcoded I am able to download only one file through
the download fucntion, I want to know that is it possible that I just
pass the name of the file to be downloaded(depending on the link
clicked) to the download function of media view and the respective
file is downloaded(extension of all files is zip).

Heres my controller code:

function download ()
 {
$this->view = 'Media';
$params = array(
  'id' => 'example.zip,
  'name' => 'example',
  'download' => true,
  'extension' => 'zip',
  'path' => APP . 'gamefiles' . DS);
   $this->set($params);
}

Guys am new here so please help me witha little more explanation than
usual.

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Media View related Query

2011-02-04 Thread newguy
Please help someone, am stuck 

On Feb 4, 11:48 am, newguy  wrote:
> no its not working, i get the following error:
>
> Error: The requested address '/users/display/game' was not found on
> this server.
>
> Moreover all the file extensions are fixed to be zip and I have files
> on my disk under gamefiles folder in app folder. On clicking link
> three I want game.zip to be downloaded where as on clicking link 2
> example1.zip should be downloaded.
>
> My hurdle is that I want to use the above stated download
> function(part of media view) to download different files based on the
> link clicked by the user and I followed what you suggested in your
> first reply to this thread but it seems that due to my limited
> knowledge I couldnt get it right, please help me by explaining in a
> little more detail.
>
> Thanks
>
> On Feb 4, 8:34 am, cricket  wrote:
>
>
>
>
>
>
>
> > On Fri, Feb 4, 2011 at 3:20 AM, newguy  wrote:
> > > In continuation of the previous post:
> > > In my site on page display there are 4 links and user clicks on it to
> > > download 4 different files. This is the cpt file for this:
>
> > > Select the game to download
> > > 
> > > link('Game 1',array('action'=>'download')); ?> > > li>
> > > link('Game 2',array('action'=>'download1')); ?> > > li>
> > > link('Game 3',array('controller' =>
> > > 'users','action' => 'download','slug' => Inflector::slug('game'))); ?
> > >>
> > > Game 4
> > > 
>
> > > This is my Router::connect:
> > >        Router::connect('/users/
> > > display/:slug',array('controller'=>'users','action'=>'download'),array('slu
> > >  g'=>'[-0-9a-
> > > z]+','pass'=>array('slug')));
> > > This file to be downloaded on clicking link three is game.zip
>
> > You're getting close. There's no need to call Inflector::slug(),
> > though, if you're going to hard-code the file.
>
> > So, is this not working?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Media View related Query

2011-02-04 Thread newguy
no its not working, i get the following error:

Error: The requested address '/users/display/game' was not found on
this server.

Moreover all the file extensions are fixed to be zip and I have files
on my disk under gamefiles folder in app folder. On clicking link
three I want game.zip to be downloaded where as on clicking link 2
example1.zip should be downloaded.

My hurdle is that I want to use the above stated download
function(part of media view) to download different files based on the
link clicked by the user and I followed what you suggested in your
first reply to this thread but it seems that due to my limited
knowledge I couldnt get it right, please help me by explaining in a
little more detail.

Thanks

On Feb 4, 8:34 am, cricket  wrote:
> On Fri, Feb 4, 2011 at 3:20 AM, newguy  wrote:
> > In continuation of the previous post:
> > In my site on page display there are 4 links and user clicks on it to
> > download 4 different files. This is the cpt file for this:
>
> > Select the game to download
> > 
> > link('Game 1',array('action'=>'download')); ?> > li>
> > link('Game 2',array('action'=>'download1')); ?> > li>
> > link('Game 3',array('controller' =>
> > 'users','action' => 'download','slug' => Inflector::slug('game'))); ?
> >>
> > Game 4
> > 
>
> > This is my Router::connect:
> >        Router::connect('/users/
> > display/:slug',array('controller'=>'users','action'=>'download'),array('slu 
> > g'=>'[-0-9a-
> > z]+','pass'=>array('slug')));
> > This file to be downloaded on clicking link three is game.zip
>
> You're getting close. There's no need to call Inflector::slug(),
> though, if you're going to hard-code the file.
>
> So, is this not working?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Media View related Query

2011-02-04 Thread newguy
In continuation of the previous post:
In my site on page display there are 4 links and user clicks on it to
download 4 different files. This is the cpt file for this:

Select the game to download

link('Game 1',array('action'=>'download')); ?>
link('Game 2',array('action'=>'download1')); ?>
link('Game 3',array('controller' =>
'users','action' => 'download','slug' => Inflector::slug('game'))); ?
>
Game 4


This is my Router::connect:
Router::connect('/users/
display/:slug',array('controller'=>'users','action'=>'download'),array('slug'=>'[-0-9a-
z]+','pass'=>array('slug')));
This file to be downloaded on clicking link three is game.zip

Please help me get this link working , thanks

On Feb 3, 11:50 pm, newguy  wrote:
> Hi I did what was suggested in the above post and now this is my
> download function:
>
> function download ($slug = null)
>          {
>         $this->view = 'Media';
>         $params = array(
>               'id' => 'example.zip,
>               'name' => 'example',
>               'download' => true,
>               'extension' => 'zip',
>               'path' => APP . 'gamefiles' . DS);
>
>        $this->set($params);
>     }
> I have three more links on whose click 3 different files should be
> downloded using this very download function, how should I make use of
> this slug to download different files. Should it be this: ???
>
> function download ($slug = null)
>          {
>         $this->view = 'Media';
>         $params = array(
>               'id' => $slug,
>               'name' => 'example',
>               'download' => true,
>               'extension' => 'zip',
>               'path' => APP . 'gamefiles' . DS);
>
>        $this->set($params);
>     }
>
> On Feb 1, 7:13 pm, cricket  wrote:
>
>
>
>
>
>
>
> > On Tue, Feb 1, 2011 at 9:57 PM, newguy  wrote:
> > > Hi
> > > I want to download four different files through 4 different links, I
> > > am using Media View to download file but I have to hardcode the file
> > > name in the download function in controller:
>
> > > function download () {
> > >        $this->view = 'Media';
> > >        $params = array(
> > >              'id' => 'example.zip',
> > >              'name' => 'example',
> > >              'download' => true,
> > >              'extension' => 'zip',
> > >              'path' => APP . 'files' . DS
> > >       );
> > >       $this->set($params);
> > >    }
>
> > > This works fine for one file, now for link number 2,3,4 do I need to
> > > create 3 different actions and give different file names in them or is
> > > there a way in which I can use download() only and depending on which
> > > link has been clicked respective file is downloaded.
>
> > Just pass the file name or slug in the link. I use the latter, where
> > each downloadable file has a title and slug:
>
> > Router::connect(
> >         '/downloads/:slug',
> >         array(
> >                 'controller' => 'files',
> >                 'action' => 'download'
> >         ),
> >         array(
> >                 'slug' => '[-0-9a-z]+',
> >                 'pass' => array('slug')
> >         )
> > );
>
> > public function download($slug = null) { ... }
>
> > Or you could pass the record ID:
>
> > Router::connect(
> >         '/downloads/:id',
> >         array(
> >                 'controller' => 'files',
> >                 'action' => 'download'
> >         ),
> >         array(
> >                 'id' => '[0-9]+',
> >                 'pass' => array('id')
> >         )
> > );
>
> > public function download($id = null) { ... }

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Media View related Query

2011-02-03 Thread newguy
Hi I did what was suggested in the above post and now this is my
download function:

function download ($slug = null)
 {
$this->view = 'Media';
$params = array(
  'id' => 'example.zip,
  'name' => 'example',
  'download' => true,
  'extension' => 'zip',
  'path' => APP . 'gamefiles' . DS);

   $this->set($params);
}
I have three more links on whose click 3 different files should be
downloded using this very download function, how should I make use of
this slug to download different files. Should it be this: ???

function download ($slug = null)
 {
$this->view = 'Media';
$params = array(
  'id' => $slug,
  'name' => 'example',
  'download' => true,
  'extension' => 'zip',
  'path' => APP . 'gamefiles' . DS);

   $this->set($params);
}


On Feb 1, 7:13 pm, cricket  wrote:
> On Tue, Feb 1, 2011 at 9:57 PM, newguy  wrote:
> > Hi
> > I want to download four different files through 4 different links, I
> > am using Media View to download file but I have to hardcode the file
> > name in the download function in controller:
>
> > function download () {
> >        $this->view = 'Media';
> >        $params = array(
> >              'id' => 'example.zip',
> >              'name' => 'example',
> >              'download' => true,
> >              'extension' => 'zip',
> >              'path' => APP . 'files' . DS
> >       );
> >       $this->set($params);
> >    }
>
> > This works fine for one file, now for link number 2,3,4 do I need to
> > create 3 different actions and give different file names in them or is
> > there a way in which I can use download() only and depending on which
> > link has been clicked respective file is downloaded.
>
> Just pass the file name or slug in the link. I use the latter, where
> each downloadable file has a title and slug:
>
> Router::connect(
>         '/downloads/:slug',
>         array(
>                 'controller' => 'files',
>                 'action' => 'download'
>         ),
>         array(
>                 'slug' => '[-0-9a-z]+',
>                 'pass' => array('slug')
>         )
> );
>
> public function download($slug = null) { ... }
>
> Or you could pass the record ID:
>
> Router::connect(
>         '/downloads/:id',
>         array(
>                 'controller' => 'files',
>                 'action' => 'download'
>         ),
>         array(
>                 'id' => '[0-9]+',
>                 'pass' => array('id')
>         )
> );
>
> public function download($id = null) { ... }

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Media View related Query

2011-02-01 Thread newguy
Hi
I want to download four different files through 4 different links, I
am using Media View to download file but I have to hardcode the file
name in the download function in controller:

function download () {
$this->view = 'Media';
$params = array(
  'id' => 'example.zip',
  'name' => 'example',
  'download' => true,
  'extension' => 'zip',
  'path' => APP . 'files' . DS
   );
   $this->set($params);
}

This works fine for one file, now for link number 2,3,4 do I need to
create 3 different actions and give different file names in them or is
there a way in which I can use download() only and depending on which
link has been clicked respective file is downloaded.

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem in simple file upload

2011-02-01 Thread newguy
 I checked the _mime types but couldnt find a error in there, am stuck
guys please suggest something.

On Feb 1, 2:50 pm, Stephen  wrote:
> Nope, you called the field "aiman". So when checking for the file, check the
> field named "aiman" for example $this->data['Model']['aiman']['tmp_name']
>
> On 1 February 2011 22:43, newguy  wrote:
>
>
>
>
>
>
>
>
>
> > Stephen one simple question, this line in upload.cpt
> >     echo $form->input('aiman', array('type' => 'file'));
> > means that I can upload only file named aiman??
>
> > On Feb 1, 2:17 pm, Stephen  wrote:
> > > This error tells me that your form is successfully reaching the correct
> > > action "upload".
>
> > > Check that $this->__mimeTypes is valid, it sounds like it isn't. The
> > syntax
> > > is correct enough.
>
> > > On 1 February 2011 21:55, newguy  wrote:
>
> > > > I tried that, this time no call was made to add action but I got this
> > > > warning:
>
> > > > Invalid argument supplied for foreach() [APP/plugins/uploader/
> > > > controllers/components/uploader.php, line 1084]
>
> > > > This is the foreach in which warning is coming:
> > > >  foreach ($this->__mimeTypes as $grouping => $mimes) {
> > > >            if (isset($mimes[$this->__data[$this->__current]['ext']]))
> > > > {
> > > >                $validExt = true;
> > > >            }
>
> > > > also I could not find the file uploaded in tmp folder under app.
>
> > > > On Feb 1, 1:44 pm, Stephen  wrote:
> > > > > Try
>
> > > > > create('User',array('action' => 'upload',
> > > > > 'type'=>'file')); ?> ?
>
> > > > > On 1 February 2011 21:41, newguy  wrote:
>
> > > > > > Hi I am following this uploader plugin to implement simple file
> > upload
> > > > > > on my site:
>
> > > > > >http://www.milesj.me/resources/script/uploader-plugin
>
> > > > > > but the problem is that when I press the upload button call to a
> > > > > > unknown action add is made, I dont have any action by the name of
> > add,
> > > > > > here is my code:
>
> > > > > > After log in user is directed to index.cpt which has the option to
> > > > > > upload score:
>
> > > > > > /
> > > > > > index.cpt
> > > > > > 
> > > > > > Hello,  > $user['last_name']); ?
> > > > > > >
> > > > > > Welcome to Game Web Site
> > > > > > 
> > > > > >  > $html->link('Downloads',array('action'=>'downloads')); ?
> > > > > > >
> > > > > > link('Upload
> > Score',array('action'=>'upload')); ?
> > > > > > >
> > > > > > link('logout', array('action' => 'logout'));
> > ?> > > > > > li>
> > > > > > 
>
> > > > > > On clicking Upload score link upload action is called
>
> > > > > > 
> > > > > > upload.cpt
> > > > > > //
>
> > > > > >  > > > > >    echo $form->create('User',array('type'=>'file'));
> > > > > >    //echo $form->file('File');
> > > > > >    echo $form->input('aiman', array('type' => 'file'));
>
> > > > > >    //echo $form->submit('Upload');
> > > > > >    echo $form->end('Upload2');
> > > > > > ?>
>
> > > > > > now when I press upload2 button I get the following error:
> > > > > > 
> > > > > > Missing Method in UsersController
> > > > > > Error: The action add is not defined in controller UsersController
>
> > > > > > Error: Create UsersController::add() in file: app/controllers/
> > > > > > users_controller.php.
>
> > > > > >  > > > > > class UsersCo

Re: Problem in simple file upload

2011-02-01 Thread newguy
Stephen one simple question, this line in upload.cpt
echo $form->input('aiman', array('type' => 'file'));
means that I can upload only file named aiman??


On Feb 1, 2:17 pm, Stephen  wrote:
> This error tells me that your form is successfully reaching the correct
> action "upload".
>
> Check that $this->__mimeTypes is valid, it sounds like it isn't. The syntax
> is correct enough.
>
> On 1 February 2011 21:55, newguy  wrote:
>
>
>
>
>
>
>
>
>
> > I tried that, this time no call was made to add action but I got this
> > warning:
>
> > Invalid argument supplied for foreach() [APP/plugins/uploader/
> > controllers/components/uploader.php, line 1084]
>
> > This is the foreach in which warning is coming:
> >  foreach ($this->__mimeTypes as $grouping => $mimes) {
> >            if (isset($mimes[$this->__data[$this->__current]['ext']]))
> > {
> >                $validExt = true;
> >            }
>
> > also I could not find the file uploaded in tmp folder under app.
>
> > On Feb 1, 1:44 pm, Stephen  wrote:
> > > Try
>
> > > create('User',array('action' => 'upload',
> > > 'type'=>'file')); ?> ?
>
> > > On 1 February 2011 21:41, newguy  wrote:
>
> > > > Hi I am following this uploader plugin to implement simple file upload
> > > > on my site:
>
> > > >http://www.milesj.me/resources/script/uploader-plugin
>
> > > > but the problem is that when I press the upload button call to a
> > > > unknown action add is made, I dont have any action by the name of add,
> > > > here is my code:
>
> > > > After log in user is directed to index.cpt which has the option to
> > > > upload score:
>
> > > > /
> > > > index.cpt
> > > > 
> > > > Hello,  > > > >
> > > > Welcome to Game Web Site
> > > > 
> > > > link('Downloads',array('action'=>'downloads')); ?
> > > > >
> > > > link('Upload Score',array('action'=>'upload')); ?
> > > > >
> > > > link('logout', array('action' => 'logout')); ?> > > > li>
> > > > 
>
> > > > On clicking Upload score link upload action is called
>
> > > > 
> > > > upload.cpt
> > > > //
>
> > > >  > > >    echo $form->create('User',array('type'=>'file'));
> > > >    //echo $form->file('File');
> > > >    echo $form->input('aiman', array('type' => 'file'));
>
> > > >    //echo $form->submit('Upload');
> > > >    echo $form->end('Upload2');
> > > > ?>
>
> > > > now when I press upload2 button I get the following error:
> > > > 
> > > > Missing Method in UsersController
> > > > Error: The action add is not defined in controller UsersController
>
> > > > Error: Create UsersController::add() in file: app/controllers/
> > > > users_controller.php.
>
> > > >  > > > class UsersController extends AppController {
>
> > > >        var $name = 'Users';
>
> > > >        function add() {
>
> > > >        }
>
> > > > }
> > > > ?>
> > > > ///
>
> > > > Here is my controller:
>
> > > > 
> > > > class UsersController extends AppController
> > > > {
> > > >    var $name = 'Users';
> > > >    var $helpers = array('Html', 'Form');
> > > >    var $components = array('Uploader.Uploader');
>
> > > >    function register()
> > > >    {
> > > >                if (!empty($this->data))
> > > >                {
> > > >                        $this->data['User']['password'] =
> > > > md5($this->data['User']
> > > > ['password']);
> > > >                        if ($this->User->save($this->data))
> > > >                                {
> > > >                  

Re: Problem in simple file upload

2011-02-01 Thread newguy
I tried that, this time no call was made to add action but I got this
warning:

Invalid argument supplied for foreach() [APP/plugins/uploader/
controllers/components/uploader.php, line 1084]

This is the foreach in which warning is coming:
 foreach ($this->__mimeTypes as $grouping => $mimes) {
if (isset($mimes[$this->__data[$this->__current]['ext']]))
{
$validExt = true;
}

also I could not find the file uploaded in tmp folder under app.


On Feb 1, 1:44 pm, Stephen  wrote:
> Try
>
> create('User',array('action' => 'upload',
> 'type'=>'file')); ?> ?
>
> On 1 February 2011 21:41, newguy  wrote:
>
>
>
>
>
>
>
>
>
> > Hi I am following this uploader plugin to implement simple file upload
> > on my site:
>
> >http://www.milesj.me/resources/script/uploader-plugin
>
> > but the problem is that when I press the upload button call to a
> > unknown action add is made, I dont have any action by the name of add,
> > here is my code:
>
> > After log in user is directed to index.cpt which has the option to
> > upload score:
>
> > /
> > index.cpt
> > 
> > Hello,  > >
> > Welcome to Game Web Site
> > 
> > link('Downloads',array('action'=>'downloads')); ?
> > >
> > link('Upload Score',array('action'=>'upload')); ?
> > >
> > link('logout', array('action' => 'logout')); ?> > li>
> > 
>
> > On clicking Upload score link upload action is called
>
> > 
> > upload.cpt
> > //
>
> >  >    echo $form->create('User',array('type'=>'file'));
> >    //echo $form->file('File');
> >    echo $form->input('aiman', array('type' => 'file'));
>
> >    //echo $form->submit('Upload');
> >    echo $form->end('Upload2');
> > ?>
>
> > now when I press upload2 button I get the following error:
> > 
> > Missing Method in UsersController
> > Error: The action add is not defined in controller UsersController
>
> > Error: Create UsersController::add() in file: app/controllers/
> > users_controller.php.
>
> >  > class UsersController extends AppController {
>
> >        var $name = 'Users';
>
> >        function add() {
>
> >        }
>
> > }
> > ?>
> > ///
>
> > Here is my controller:
>
> > 
> > class UsersController extends AppController
> > {
> >    var $name = 'Users';
> >    var $helpers = array('Html', 'Form');
> >    var $components = array('Uploader.Uploader');
>
> >    function register()
> >    {
> >                if (!empty($this->data))
> >                {
> >                        $this->data['User']['password'] =
> > md5($this->data['User']
> > ['password']);
> >                        if ($this->User->save($this->data))
> >                                {
> >                                        $this->Session->setFlash('Your
> > registration information was
> > accepted');
> >                                        $this->Session->write('user',
> > $this->data['User']['username']);
>
> >                                        $this->redirect(array('action' =>
> > 'index'), null, true);
> >                                }
> >                        else {
> >                                        $this->data['User']['password'] =
> > '';
> >                                        $this->Session->setFlash('There was
> > a problem saving this
> > information');
> >                                 }
> >                }
> >    }
>
> >   function login()
> >    {
> >                if ($this->data)
> >                {
> >                        $results =
> > $this->User->findByUsername($this->data['User']
> > ['username']);
> >                        if ($results && $results['User']['password'] ==
> > md5($this-
> > >data['

Problem in simple file upload

2011-02-01 Thread newguy
Hi I am following this uploader plugin to implement simple file upload
on my site:

http://www.milesj.me/resources/script/uploader-plugin

but the problem is that when I press the upload button call to a
unknown action add is made, I dont have any action by the name of add,
here is my code:

After log in user is directed to index.cpt which has the option to
upload score:

/
index.cpt

Hello, 
Welcome to Game Web Site

link('Downloads',array('action'=>'downloads')); ?
>
link('Upload Score',array('action'=>'upload')); ?
>
link('logout', array('action' => 'logout')); ?>


On clicking Upload score link upload action is called


upload.cpt
//

create('User',array('type'=>'file'));
//echo $form->file('File');
echo $form->input('aiman', array('type' => 'file'));

//echo $form->submit('Upload');
echo $form->end('Upload2');
?>

now when I press upload2 button I get the following error:

Missing Method in UsersController
Error: The action add is not defined in controller UsersController

Error: Create UsersController::add() in file: app/controllers/
users_controller.php.


///

Here is my controller:

data))
{
$this->data['User']['password'] = 
md5($this->data['User']
['password']);
if ($this->User->save($this->data))
{
$this->Session->setFlash('Your 
registration information was
accepted');
$this->Session->write('user', 
$this->data['User']['username']);

$this->redirect(array('action' => 
'index'), null, true);
}
else {
$this->data['User']['password'] = '';
$this->Session->setFlash('There was a 
problem saving this
information');
 }
}
}



   function login()
{
if ($this->data)
{
$results = 
$this->User->findByUsername($this->data['User']
['username']);
if ($results && $results['User']['password'] == 
md5($this-
>data['User']   ['password']))
{
$this->Session->write('user', 
$this->data['User']['username']);
$this->redirect(array('action' => 
'upload'), null, true);
}
else {
$this->set('error', true);
 }
}
}



   function logout()
{
$this->Session->delete('user');
$this->redirect(array('action' => 'login'), null, true);
}


function index()
{
$username = $this->Session->read('user');
if ($username)
{
$results = $this->User->findByUsername($username);
$this->set('user', $results['User']);
}
else {
$this->redirect(array('action' => 'login'), null, true);
 }
}



function downloads()
{
}



   function upload()
{

if (!empty($this->data))
  {
if ($data = $this->Uploader->upload('nam'))
 {
// nam is the file name
//var_dump($this->data); print '';

$this->redirect(array('action'=>'login'),null,true);
}
  }

}

}
?>


Please Help me to uplaod this file .

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Newbie file upload question

2011-01-31 Thread newguy
Hi there
This should be helpful:
http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/

thanks

On Jan 31, 12:00 pm, Paul Wheatley 
wrote:
> Hi,
> Very new to CakePHP and my first post here, I am loving Cake so far but have 
> run up against a small hurdle.
> Can anyone point me in the direction of instructions on creating a form with 
> a file upload field? It's for a registration form where the user uploads 
> normal stuff (name, address, etc...) and an image or logo of their company.
> From what I've seen of Cake so far I think it should be simple enough but I 
> can't work it out, can anyone help?
> Paul

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Using two tables

2011-01-30 Thread newguy
If I understand you correctly you want me to make a new
model,controller for this file upload functionality??
If yes then how should I relate them. If thats now what u meant then
please throw some more light on this.

Thanks


On Jan 30, 3:48 am, "Dr. Tarique Sani"  wrote:
> Why not relate the User Model to the Files model?
>
> User hasMany Files...
>
> Tarique
>
>
>
>
>
>
>
>
>
> On Sun, Jan 30, 2011 at 5:03 PM, newguy  wrote:
> > Hi
> > I am working on implementing file upload functionality in my site, I
> > have a table called users which contains user's login information.
> > I want to have another table my_files with the following fields in
> > which I can store the file uploaded by the user.
>
> > `id`, `name`, `created`, `modified'
>
> > My database.php file has this:
>
> >  > class DATABASE_CONFIG
> > {
> >   var $default = array('driver'   => 'mysql',
> >                        'connect'  => 'mysql_pconnect',
> >                        'host'     => 'localhost',
> >                        'login'    => 'root',
> >                        'password' => 'root',
> >                        'database' => 'users' );
> > }
> > ?>
>
> > I want to know how should I include this new table in my code and use
> > it to save the uploaded file and its information.
>
> > This is my view file for upload option(upload.ctp):
>
> >  >    echo $form->create('User', array('action' => 'upload', 'type' =>
> > 'file'));
> >    echo $form->file('File');
> >    echo $form->submit('Upload');
> >    echo $form->end();
> > ?>
>
> > This is my only model file:
> >  > class User extends AppModel
> > {
> >  var $name = 'User';
> >  var $otherDB='my_files';
> >  var $validate = array(
> >    'username' => array(
> >    'rule' => 'isUnique',
> >    'message' => 'Username not available'
> >    ),
> >    'password' => array(
> >    'rule' => array('minLength',8),
> >    'message' => 'Minimum length is 8'
> >    ),
> >    'email' => array(
> >    'rule' =>  array('email',true),
> >    'message' => 'Enter valid email address'
> >    )
> >  );
>
> > }
> > ?>
>
> > I have nothing for upload in the controller.
>
> > I have read previous posts about using multiple tables but could
> > really understand because of my limited knowledge in php/cake.
> > Thanks
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Using two tables

2011-01-30 Thread newguy
Hi
I am working on implementing file upload functionality in my site, I
have a table called users which contains user's login information.
I want to have another table my_files with the following fields in
which I can store the file uploaded by the user.

`id`, `name`, `created`, `modified'

My database.php file has this:

 'mysql',
'connect'  => 'mysql_pconnect',
'host' => 'localhost',
'login'=> 'root',
'password' => 'root',
'database' => 'users' );
}
?>


I want to know how should I include this new table in my code and use
it to save the uploaded file and its information.

This is my view file for upload option(upload.ctp):

create('User', array('action' => 'upload', 'type' =>
'file'));
echo $form->file('File');
echo $form->submit('Upload');
echo $form->end();
?>


This is my only model file:
 array(
'rule' => 'isUnique',
'message' => 'Username not available'
),
'password' => array(
'rule' => array('minLength',8),
'message' => 'Minimum length is 8'
),
'email' => array(
'rule' =>  array('email',true),
'message' => 'Enter valid email address'
)
  );


}
?>

I have nothing for upload in the controller.

I have read previous posts about using multiple tables but could
really understand because of my limited knowledge in php/cake.
Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: New to cake and need advice

2011-01-29 Thread newguy
Thanks guys u all have given me lot of hope and encouragement

On Jan 29, 6:32 am, "Dr. Tarique Sani"  wrote:
> Go for it! start developing and come back with specific problems - you will
> find plenty of help
>
> Cheers
> Tarique
>
>
>
>
>
> On Thu, Jan 27, 2011 at 11:20 PM, newguy  wrote:
> > Hi everyone
> > Am new to cake and php but  I have 5 - 6 years of coding experience in
> > c/c++. I have basic php knowledge through w3schools, I am in doubt
> > whether starting with cake is a good decision or not, am comfortable
> > with MVC architecture and I really want to learn cake framework but my
> > limited experience with php is making me ask for advice.
>
> > Thanks
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Helper File

2011-01-29 Thread newguy
yeah may be, anyways thanks for your efforts :)

On Jan 29, 12:48 am, Sam Sherlock  wrote:
> It maybe out of date, in part.
>
> Editors note:
> This series was
> originally published in 2006, and
> updated in 2007 and 2008. Since
> its last publication, CakePHP
> developers made changes to
> CakePHP resulting in multiple
> revisions of this series. This
> revision was written for CakePHP
> V1.2.2.8120.
>
> On 29/01/2011, newguy  wrote:
>
>
>
>
>
>
>
>
>
> > No as I said am new here I am following this tutorial:
> >http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/s...
>
> > this page is where helpers were introduced.
>
> > Thanks
>
> > On Jan 29, 12:27 am, Sam Sherlock  wrote:
> >> strange. Looks fine
>
> >> and you have not edited the core at all?
>
> >> Maybe I am missing something.
>
> >> On 29/01/2011, newguy  wrote:
>
> >> > yes thats line 3
>
> >> > On Jan 29, 12:15 am, Sam Sherlock  wrote:
> >> >> echo $html->tableHeaders
> >> >> (array_keys($knownusers[0]
> >> >> ['User']));
>
> >> >> is that line 3
>
> >> >> On 29/01/2011, newguy  wrote:
>
> >> >> > hey Sam
> >> >> > I made the change but still I get teh following error:
>
> >> >> > Notice (8): Undefined property: View::$Html [APP/views/users/
> >> >> > knownusers.ctp, line 3]
>
> >> >> > Fatal error: Call to a member function tableHeaders() on a non-object
> >> >> > in
> >> >> > /Applications/MAMP/htdocs/cake_1.2.5/app/views/users/knownusers.ctp
> >> >> > on line 3
>
> >> >> > this is my controller code:
> >> >> >  >> >> > class UsersController extends AppController
> >> >> > {
> >> >> >    var $name='Users';
> >> >> >    var $helpers = array('Html','Form');
>
> >> >> >   function register()
> >> >> >   {
> >> >> >     if (!empty($this->params['form']))
> >> >> >     {
> >> >> >       if ($this->User->save($this->params['form']))
> >> >> >       {
> >> >> >         $this->flash('Your registration information was
> >> >> > accepted.','register');
> >> >> >       } else {
> >> >> >         $this->flash('There was a problem with your registration', '/
> >> >> > register');
> >> >> >       }
> >> >> >     }
> >> >> >   }
>
> >> >> > function knownusers()
> >> >> > {
> >> >> > $this->set('knownusers',$this->User->findAll(null, array('id',
> >> >> > 'username', 'first_name','last_name'), 'id DESC'));
> >> >> > }
>
> >> >> > }
> >> >> > ?>
>
> >> >> > Thanks
>
> >> >> > On Jan 28, 11:57 pm, Sam Sherlock  wrote:
> >> >> >> On 29/01/2011, Jeremy Burns | Class Outfit
> >> >> >> 
> >> >> >> wrote:
>
> >> >> >> > What version of Cake are you using?
>
> >> >> >> > The Html helper is available out of the box. Have you declared any
> >> >> >> > other
> >> >> >> > helpers in your controller?
>
> >> >> >> > Jeremy Burns
> >> >> >> > Class Outfit
>
> >> >> >> > jeremybu...@classoutfit.com
> >> >> >> >http://www.classoutfit.com
>
> >> >> >> > On 29 Jan 2011, at 07:44, newguy wrote:
>
> >> >> >> >> I tried that but no change I still get the same error :(
>
> >> >> >> >> On Jan 28, 11:35 pm, Jeremy Burns | Class Outfit
> >> >> >> >>  wrote:
> >> >> >> >>> Try replacing $html-> with:
>
> >> >> >> >>> echo $this->Html->...
>
> >> >> >> >>> Jeremy Burns
> >> >> >> >>> Class Outfit
>
> >> >> >> >>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> >&

Re: Helper File

2011-01-29 Thread newguy
No as I said am new here I am following this tutorial:
http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/section4.html

this page is where helpers were introduced.

Thanks

On Jan 29, 12:27 am, Sam Sherlock  wrote:
> strange. Looks fine
>
> and you have not edited the core at all?
>
> Maybe I am missing something.
>
> On 29/01/2011, newguy  wrote:
>
>
>
>
>
>
>
>
>
> > yes thats line 3
>
> > On Jan 29, 12:15 am, Sam Sherlock  wrote:
> >> echo $html->tableHeaders
> >> (array_keys($knownusers[0]
> >> ['User']));
>
> >> is that line 3
>
> >> On 29/01/2011, newguy  wrote:
>
> >> > hey Sam
> >> > I made the change but still I get teh following error:
>
> >> > Notice (8): Undefined property: View::$Html [APP/views/users/
> >> > knownusers.ctp, line 3]
>
> >> > Fatal error: Call to a member function tableHeaders() on a non-object
> >> > in /Applications/MAMP/htdocs/cake_1.2.5/app/views/users/knownusers.ctp
> >> > on line 3
>
> >> > this is my controller code:
> >> >  >> > class UsersController extends AppController
> >> > {
> >> >    var $name='Users';
> >> >    var $helpers = array('Html','Form');
>
> >> >   function register()
> >> >   {
> >> >     if (!empty($this->params['form']))
> >> >     {
> >> >       if ($this->User->save($this->params['form']))
> >> >       {
> >> >         $this->flash('Your registration information was
> >> > accepted.','register');
> >> >       } else {
> >> >         $this->flash('There was a problem with your registration', '/
> >> > register');
> >> >       }
> >> >     }
> >> >   }
>
> >> > function knownusers()
> >> > {
> >> > $this->set('knownusers',$this->User->findAll(null, array('id',
> >> > 'username', 'first_name','last_name'), 'id DESC'));
> >> > }
>
> >> > }
> >> > ?>
>
> >> > Thanks
>
> >> > On Jan 28, 11:57 pm, Sam Sherlock  wrote:
> >> >> On 29/01/2011, Jeremy Burns | Class Outfit
> >> >> 
> >> >> wrote:
>
> >> >> > What version of Cake are you using?
>
> >> >> > The Html helper is available out of the box. Have you declared any
> >> >> > other
> >> >> > helpers in your controller?
>
> >> >> > Jeremy Burns
> >> >> > Class Outfit
>
> >> >> > jeremybu...@classoutfit.com
> >> >> >http://www.classoutfit.com
>
> >> >> > On 29 Jan 2011, at 07:44, newguy wrote:
>
> >> >> >> I tried that but no change I still get the same error :(
>
> >> >> >> On Jan 28, 11:35 pm, Jeremy Burns | Class Outfit
> >> >> >>  wrote:
> >> >> >>> Try replacing $html-> with:
>
> >> >> >>> echo $this->Html->...
>
> >> >> >>> Jeremy Burns
> >> >> >>> Class Outfit
>
> >> >> >>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> >> >>> On 29 Jan 2011, at 07:29, newguy wrote:
>
> >> >> >>>> here is the code(knownusers.ctp) where I have used the helpers:
>
> >> >> >>>> 
> >> >> >>>>  >> >> >>>> echo $html->tableHeaders(array_keys($knownusers[0]['User']));
> >> >> >>>> foreach ($knownusers as $thisuser)
> >> >> >>>> {
> >> >> >>>>    echo $html->tableCells($thisuser['User']);
> >> >> >>>> }
>
> >> >> >>>> ?>
> >> >> >>>> 
>
> >> >> >>>> and this is the error which I get when I access
> >> >> >>>>http://localhost:/cake_1.2.5/users/knownusersfrombrowser:
>
> >> >> >>>> Missing Helper File
> >> >> >>>> Error: The helper file app/views/helpers/h_t_m_l.php can not be
> >> >> >>>> found
> >> >> >>>> or does not exist.
>

Re: Helper File

2011-01-29 Thread newguy
yes

On Jan 29, 12:20 am, Sam Sherlock  wrote:
> of the view file (ctp)
> app/users/knowusers.ctp
>
> On 29/01/2011, Sam Sherlock  wrote:
>
>
>
>
>
>
>
>
>
> > echo $html->tableHeaders
> > (array_keys($knownusers[0]
> > ['User']));
>
> > is that line 3
>
> > On 29/01/2011, newguy  wrote:
> >> hey Sam
> >> I made the change but still I get teh following error:
>
> >> Notice (8): Undefined property: View::$Html [APP/views/users/
> >> knownusers.ctp, line 3]
>
> >> Fatal error: Call to a member function tableHeaders() on a non-object
> >> in /Applications/MAMP/htdocs/cake_1.2.5/app/views/users/knownusers.ctp
> >> on line 3
>
> >> this is my controller code:
> >>  >> class UsersController extends AppController
> >> {
> >>        var $name='Users';
> >>        var $helpers = array('Html','Form');
>
> >>   function register()
> >>   {
> >>     if (!empty($this->params['form']))
> >>     {
> >>       if ($this->User->save($this->params['form']))
> >>       {
> >>         $this->flash('Your registration information was
> >> accepted.','register');
> >>       } else {
> >>         $this->flash('There was a problem with your registration', '/
> >> register');
> >>       }
> >>     }
> >>   }
>
> >> function knownusers()
> >> {
> >> $this->set('knownusers',$this->User->findAll(null, array('id',
> >> 'username', 'first_name','last_name'), 'id DESC'));
> >> }
>
> >> }
> >> ?>
>
> >> Thanks
>
> >> On Jan 28, 11:57 pm, Sam Sherlock  wrote:
> >>> On 29/01/2011, Jeremy Burns | Class Outfit 
> >>> wrote:
>
> >>> > What version of Cake are you using?
>
> >>> > The Html helper is available out of the box. Have you declared any
> >>> > other
> >>> > helpers in your controller?
>
> >>> > Jeremy Burns
> >>> > Class Outfit
>
> >>> > jeremybu...@classoutfit.com
> >>> >http://www.classoutfit.com
>
> >>> > On 29 Jan 2011, at 07:44, newguy wrote:
>
> >>> >> I tried that but no change I still get the same error :(
>
> >>> >> On Jan 28, 11:35 pm, Jeremy Burns | Class Outfit
> >>> >>  wrote:
> >>> >>> Try replacing $html-> with:
>
> >>> >>> echo $this->Html->...
>
> >>> >>> Jeremy Burns
> >>> >>> Class Outfit
>
> >>> >>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >>> >>> On 29 Jan 2011, at 07:29, newguy wrote:
>
> >>> >>>> here is the code(knownusers.ctp) where I have used the helpers:
>
> >>> >>>> 
> >>> >>>>  >>> >>>> echo $html->tableHeaders(array_keys($knownusers[0]['User']));
> >>> >>>> foreach ($knownusers as $thisuser)
> >>> >>>> {
> >>> >>>>    echo $html->tableCells($thisuser['User']);
> >>> >>>> }
>
> >>> >>>> ?>
> >>> >>>> 
>
> >>> >>>> and this is the error which I get when I access
> >>> >>>>http://localhost:/cake_1.2.5/users/knownusersfrombrowser:
>
> >>> >>>> Missing Helper File
> >>> >>>> Error: The helper file app/views/helpers/h_t_m_l.php can not be
> >>> >>>> found
> >>> >>>> or does not exist.
>
> >>> >>>> Error: Create the class below in file:
> >>> >>>> app/views/helpers/h_t_m_l.php
>
> >>> >>>>  >>> >>>> class HTMLHelper extends AppHelper {
>
> >>> >>>> }
> >>> >>>> ?>
> >>> >>>> Notice: If you want to customize this error message, create
> >>> >>>> app/views/
> >>> >>>> errors/missing_helper_file.ctp
>
> >>> >>>> Thanks
> >>> >>>> On Jan 28, 11:16 pm, Jeremy Burns | Class Outfit
> >>> >>>>  wrote:

Re: Helper File

2011-01-29 Thread newguy
yes thats line 3

On Jan 29, 12:15 am, Sam Sherlock  wrote:
> echo $html->tableHeaders
> (array_keys($knownusers[0]
> ['User']));
>
> is that line 3
>
> On 29/01/2011, newguy  wrote:
>
>
>
>
>
>
>
>
>
> > hey Sam
> > I made the change but still I get teh following error:
>
> > Notice (8): Undefined property: View::$Html [APP/views/users/
> > knownusers.ctp, line 3]
>
> > Fatal error: Call to a member function tableHeaders() on a non-object
> > in /Applications/MAMP/htdocs/cake_1.2.5/app/views/users/knownusers.ctp
> > on line 3
>
> > this is my controller code:
> >  > class UsersController extends AppController
> > {
> >    var $name='Users';
> >    var $helpers = array('Html','Form');
>
> >   function register()
> >   {
> >     if (!empty($this->params['form']))
> >     {
> >       if ($this->User->save($this->params['form']))
> >       {
> >         $this->flash('Your registration information was
> > accepted.','register');
> >       } else {
> >         $this->flash('There was a problem with your registration', '/
> > register');
> >       }
> >     }
> >   }
>
> > function knownusers()
> > {
> > $this->set('knownusers',$this->User->findAll(null, array('id',
> > 'username', 'first_name','last_name'), 'id DESC'));
> > }
>
> > }
> > ?>
>
> > Thanks
>
> > On Jan 28, 11:57 pm, Sam Sherlock  wrote:
> >> On 29/01/2011, Jeremy Burns | Class Outfit 
> >> wrote:
>
> >> > What version of Cake are you using?
>
> >> > The Html helper is available out of the box. Have you declared any other
> >> > helpers in your controller?
>
> >> > Jeremy Burns
> >> > Class Outfit
>
> >> > jeremybu...@classoutfit.com
> >> >http://www.classoutfit.com
>
> >> > On 29 Jan 2011, at 07:44, newguy wrote:
>
> >> >> I tried that but no change I still get the same error :(
>
> >> >> On Jan 28, 11:35 pm, Jeremy Burns | Class Outfit
> >> >>  wrote:
> >> >>> Try replacing $html-> with:
>
> >> >>> echo $this->Html->...
>
> >> >>> Jeremy Burns
> >> >>> Class Outfit
>
> >> >>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> >>> On 29 Jan 2011, at 07:29, newguy wrote:
>
> >> >>>> here is the code(knownusers.ctp) where I have used the helpers:
>
> >> >>>> 
> >> >>>>  >> >>>> echo $html->tableHeaders(array_keys($knownusers[0]['User']));
> >> >>>> foreach ($knownusers as $thisuser)
> >> >>>> {
> >> >>>>    echo $html->tableCells($thisuser['User']);
> >> >>>> }
>
> >> >>>> ?>
> >> >>>> 
>
> >> >>>> and this is the error which I get when I access
> >> >>>>http://localhost:/cake_1.2.5/users/knownusersfrombrowser:
>
> >> >>>> Missing Helper File
> >> >>>> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> >> >>>> or does not exist.
>
> >> >>>> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>
> >> >>>>  >> >>>> class HTMLHelper extends AppHelper {
>
> >> >>>> }
> >> >>>> ?>
> >> >>>> Notice: If you want to customize this error message, create
> >> >>>> app/views/
> >> >>>> errors/missing_helper_file.ctp
>
> >> >>>> Thanks
> >> >>>> On Jan 28, 11:16 pm, Jeremy Burns | Class Outfit
> >> >>>>  wrote:
> >> >>>>> Can you show the line of code that is being called and returning
> >> >>>>> this
> >> >>>>> error?
>
> >> >>>>> Jeremy Burns
> >> >>>>> Class Outfit
>
> >> >>>>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> >>>>> On 29 Jan 2011, at 07:09, newguy wrote:
>
> >> >>>>>> Hi guys
> >> >>>>

Re: Helper File

2011-01-29 Thread newguy
hey Sam
I made the change but still I get teh following error:

Notice (8): Undefined property: View::$Html [APP/views/users/
knownusers.ctp, line 3]

Fatal error: Call to a member function tableHeaders() on a non-object
in /Applications/MAMP/htdocs/cake_1.2.5/app/views/users/knownusers.ctp
on line 3

this is my controller code:
params['form']))
{
  if ($this->User->save($this->params['form']))
  {
$this->flash('Your registration information was
accepted.','register');
  } else {
$this->flash('There was a problem with your registration', '/
register');
  }
}
  }

function knownusers()
{
$this->set('knownusers',$this->User->findAll(null, array('id',
'username', 'first_name','last_name'), 'id DESC'));
}

}
?>


Thanks

On Jan 28, 11:57 pm, Sam Sherlock  wrote:
> On 29/01/2011, Jeremy Burns | Class Outfit  
> wrote:
>
>
>
>
>
>
>
>
>
> > What version of Cake are you using?
>
> > The Html helper is available out of the box. Have you declared any other
> > helpers in your controller?
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.com
> >http://www.classoutfit.com
>
> > On 29 Jan 2011, at 07:44, newguy wrote:
>
> >> I tried that but no change I still get the same error :(
>
> >> On Jan 28, 11:35 pm, Jeremy Burns | Class Outfit
> >>  wrote:
> >>> Try replacing $html-> with:
>
> >>> echo $this->Html->...
>
> >>> Jeremy Burns
> >>> Class Outfit
>
> >>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >>> On 29 Jan 2011, at 07:29, newguy wrote:
>
> >>>> here is the code(knownusers.ctp) where I have used the helpers:
>
> >>>> 
> >>>>  >>>> echo $html->tableHeaders(array_keys($knownusers[0]['User']));
> >>>> foreach ($knownusers as $thisuser)
> >>>> {
> >>>>    echo $html->tableCells($thisuser['User']);
> >>>> }
>
> >>>> ?>
> >>>> 
>
> >>>> and this is the error which I get when I access
> >>>>http://localhost:/cake_1.2.5/users/knownusersfrombrowser:
>
> >>>> Missing Helper File
> >>>> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> >>>> or does not exist.
>
> >>>> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>
> >>>>  >>>> class HTMLHelper extends AppHelper {
>
> >>>> }
> >>>> ?>
> >>>> Notice: If you want to customize this error message, create app/views/
> >>>> errors/missing_helper_file.ctp
>
> >>>> Thanks
> >>>> On Jan 28, 11:16 pm, Jeremy Burns | Class Outfit
> >>>>  wrote:
> >>>>> Can you show the line of code that is being called and returning this
> >>>>> error?
>
> >>>>> Jeremy Burns
> >>>>> Class Outfit
>
> >>>>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >>>>> On 29 Jan 2011, at 07:09, newguy wrote:
>
> >>>>>> Hi guys
> >>>>>> am new to cakephp and Iam developing a simple user registration and
> >>>>>> login system for my site, I used two helpers tableHeaders and
> >>>>>> tableCells in my view code but I get the following errors:
>
> >>>>>> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> >>>>>> or does not exist.
>
> >>>>>> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>
> >>>>>> I realized that in folder helpers I have a file named empty and there
> >>>>>> is no code there, so if I understand correctly in order to use helpers
> >>>>>> I need to put the code in this helper file and should it be in the
> >>>>>> form of functions, in what way should code be written in this file
> >>>>>> under folder helper and what should be the name of this file.
> >>>>>> If someone can please give a small example I would be grateful.
>
> >>>>>> Thanks
>
> >>>>>> --
> >>>>>> Our newest site for the community: CakePHP Video
> >>>>>> Tutorialshttp://tv.cakephp.org
> 

Re: Helper File

2011-01-28 Thread newguy
am using cake 1.2.5 and no i havent declared any other helpers in my
controller.

On Jan 28, 11:47 pm, Jeremy Burns | Class Outfit
 wrote:
> What version of Cake are you using?
>
> The Html helper is available out of the box. Have you declared any other 
> helpers in your controller?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 29 Jan 2011, at 07:44, newguy wrote:
>
>
>
>
>
>
>
> > I tried that but no change I still get the same error :(
>
> > On Jan 28, 11:35 pm, Jeremy Burns | Class Outfit
> >  wrote:
> >> Try replacing $html-> with:
>
> >> echo $this->Html->...
>
> >> Jeremy Burns
> >> Class Outfit
>
> >> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> On 29 Jan 2011, at 07:29, newguy wrote:
>
> >>> here is the code(knownusers.ctp) where I have used the helpers:
>
> >>> 
> >>>  >>> echo $html->tableHeaders(array_keys($knownusers[0]['User']));
> >>> foreach ($knownusers as $thisuser)
> >>> {
> >>>    echo $html->tableCells($thisuser['User']);
> >>> }
>
> >>> ?>
> >>> 
>
> >>> and this is the error which I get when I access
> >>>http://localhost:/cake_1.2.5/users/knownusersfrombrowser:
>
> >>> Missing Helper File
> >>> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> >>> or does not exist.
>
> >>> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>
> >>>  >>> class HTMLHelper extends AppHelper {
>
> >>> }
> >>> ?>
> >>> Notice: If you want to customize this error message, create app/views/
> >>> errors/missing_helper_file.ctp
>
> >>> Thanks
> >>> On Jan 28, 11:16 pm, Jeremy Burns | Class Outfit
> >>>  wrote:
> >>>> Can you show the line of code that is being called and returning this 
> >>>> error?
>
> >>>> Jeremy Burns
> >>>> Class Outfit
>
> >>>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >>>> On 29 Jan 2011, at 07:09, newguy wrote:
>
> >>>>> Hi guys
> >>>>> am new to cakephp and Iam developing a simple user registration and
> >>>>> login system for my site, I used two helpers tableHeaders and
> >>>>> tableCells in my view code but I get the following errors:
>
> >>>>> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> >>>>> or does not exist.
>
> >>>>> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>
> >>>>> I realized that in folder helpers I have a file named empty and there
> >>>>> is no code there, so if I understand correctly in order to use helpers
> >>>>> I need to put the code in this helper file and should it be in the
> >>>>> form of functions, in what way should code be written in this file
> >>>>> under folder helper and what should be the name of this file.
> >>>>> If someone can please give a small example I would be grateful.
>
> >>>>> Thanks
>
> >>>>> --
> >>>>> Our newest site for the community: CakePHP Video 
> >>>>> Tutorialshttp://tv.cakephp.org
> >>>>> Check out the new CakePHP Questions 
> >>>>> sitehttp://ask.cakephp.organdhelpothers with their CakePHP related 
> >>>>> questions.
>
> >>>>> To unsubscribe from this group, send email to
> >>>>> cake-php+unsubscr...@googlegroups.com For more options, visit this 
> >>>>> group athttp://groups.google.com/group/cake-php
>
> >>> --
> >>> Our newest site for the community: CakePHP Video 
> >>> Tutorialshttp://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> >>> others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>> athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Helper File

2011-01-28 Thread newguy
I tried that but no change I still get the same error :(

On Jan 28, 11:35 pm, Jeremy Burns | Class Outfit
 wrote:
> Try replacing $html-> with:
>
> echo $this->Html->...
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 29 Jan 2011, at 07:29, newguy wrote:
>
>
>
>
>
>
>
> > here is the code(knownusers.ctp) where I have used the helpers:
>
> > 
> >  > echo $html->tableHeaders(array_keys($knownusers[0]['User']));
> > foreach ($knownusers as $thisuser)
> > {
> >    echo $html->tableCells($thisuser['User']);
> > }
>
> > ?>
> > 
>
> > and this is the error which I get when I access
> >http://localhost:/cake_1.2.5/users/knownusersfrom browser:
>
> > Missing Helper File
> > Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> > or does not exist.
>
> > Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>
> >  > class HTMLHelper extends AppHelper {
>
> > }
> > ?>
> > Notice: If you want to customize this error message, create app/views/
> > errors/missing_helper_file.ctp
>
> > Thanks
> > On Jan 28, 11:16 pm, Jeremy Burns | Class Outfit
> >  wrote:
> >> Can you show the line of code that is being called and returning this 
> >> error?
>
> >> Jeremy Burns
> >> Class Outfit
>
> >> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> On 29 Jan 2011, at 07:09, newguy wrote:
>
> >>> Hi guys
> >>> am new to cakephp and Iam developing a simple user registration and
> >>> login system for my site, I used two helpers tableHeaders and
> >>> tableCells in my view code but I get the following errors:
>
> >>> Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> >>> or does not exist.
>
> >>> Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>
> >>> I realized that in folder helpers I have a file named empty and there
> >>> is no code there, so if I understand correctly in order to use helpers
> >>> I need to put the code in this helper file and should it be in the
> >>> form of functions, in what way should code be written in this file
> >>> under folder helper and what should be the name of this file.
> >>> If someone can please give a small example I would be grateful.
>
> >>> Thanks
>
> >>> --
> >>> Our newest site for the community: CakePHP Video 
> >>> Tutorialshttp://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> >>> others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>> athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Helper File

2011-01-28 Thread newguy
here is the code(knownusers.ctp) where I have used the helpers:


tableHeaders(array_keys($knownusers[0]['User']));
foreach ($knownusers as $thisuser)
{
echo $html->tableCells($thisuser['User']);
}

?>


and this is the error which I get when I access
http://localhost:/cake_1.2.5/users/knownusers from browser:

Missing Helper File
Error: The helper file app/views/helpers/h_t_m_l.php can not be found
or does not exist.

Error: Create the class below in file: app/views/helpers/h_t_m_l.php


Notice: If you want to customize this error message, create app/views/
errors/missing_helper_file.ctp


Thanks
On Jan 28, 11:16 pm, Jeremy Burns | Class Outfit
 wrote:
> Can you show the line of code that is being called and returning this error?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 29 Jan 2011, at 07:09, newguy wrote:
>
>
>
>
>
>
>
> > Hi guys
> > am new to cakephp and Iam developing a simple user registration and
> > login system for my site, I used two helpers tableHeaders and
> > tableCells in my view code but I get the following errors:
>
> > Error: The helper file app/views/helpers/h_t_m_l.php can not be found
> > or does not exist.
>
> > Error: Create the class below in file: app/views/helpers/h_t_m_l.php
>
> > I realized that in folder helpers I have a file named empty and there
> > is no code there, so if I understand correctly in order to use helpers
> > I need to put the code in this helper file and should it be in the
> > form of functions, in what way should code be written in this file
> > under folder helper and what should be the name of this file.
> > If someone can please give a small example I would be grateful.
>
> > Thanks
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Helper File

2011-01-28 Thread newguy
Hi guys
am new to cakephp and Iam developing a simple user registration and
login system for my site, I used two helpers tableHeaders and
tableCells in my view code but I get the following errors:

Error: The helper file app/views/helpers/h_t_m_l.php can not be found
or does not exist.

Error: Create the class below in file: app/views/helpers/h_t_m_l.php

I realized that in folder helpers I have a file named empty and there
is no code there, so if I understand correctly in order to use helpers
I need to put the code in this helper file and should it be in the
form of functions, in what way should code be written in this file
under folder helper and what should be the name of this file.
If someone can please give a small example I would be grateful.

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: New to cake and need advice

2011-01-27 Thread newguy
Thanks Ryan I appreciate your help.

On Jan 27, 8:35 pm, Ryan Schmidt  wrote:
> On Jan 27, 2011, at 11:50, newguy wrote:
>
> > Am new to cake and php but  I have 5 - 6 years of coding experience in
> > c/c++. I have basic php knowledge through w3schools, I am in doubt
> > whether starting with cake is a good decision or not, am comfortable
> > with MVC architecture and I really want to learn cake framework but my
> > limited experience with php is making me ask for advice.
>
> I'd recommend you go through some of the tutorials that are available. Watch 
> some screencasts about building a basic CakePHP application (the blog app is 
> a common one) and try to follow along, built your own app that does what 
> they're doing. Try making small changes. The PHP documentation is pretty good 
> at helping you learn how to use individual functions, once you get to 
> something you need a PHP function for. And of course the CakePHP book is 
> there as a reference for how CakePHP fits together.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


New to cake and need advice

2011-01-27 Thread newguy
Hi everyone
Am new to cake and php but  I have 5 - 6 years of coding experience in
c/c++. I have basic php knowledge through w3schools, I am in doubt
whether starting with cake is a good decision or not, am comfortable
with MVC architecture and I really want to learn cake framework but my
limited experience with php is making me ask for advice.

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php