$this->Emaildata->save($this-data);
should be
$this->Emaildata->save($this->data);
On Feb 1, 3:34 pm, "lynda" <[EMAIL PROTECTED]> wrote:
> I have this form with data input fields: firstName, lastName, title,
> company, email, and when I clcik save, it doesn't save and no any
> error come out. If I use refresh, is will say "the page you are trying
> to view contain POSTDAT..", I have been search this group for this
> issue, however, I was not able to know why it doesn't work. Please
> help me. This seems so easy, I just don't know how to do it.
> Best Regards
> Lynda
> my table has following fields:
> emailId: unsigned, auto_incre
> firstName, varchar
> lastName: varchar
> title:varchar
> company: varchar
> email: varchar
>
> add.thtml
>
> <p><strong>Please fill and send the following form for your
> registration</strong></p>
>
> <form action="<?php echo $html->url("/emaildatas/add");?>"
> method="post">
> <?php //echo $html->input('Emaildata/emailId');?>
> <p> First Name: <?php echo $html->input('Emaildata/firstName',
> array('size'=>'40'));?></p>
> <p> Last Name: <?php echo $html->input('Emaildata/lastName',
> array('size'=>'40');?></p>
> <p> Title: <?php echo $html->input('Emaildata/title',
> array('size'=>'40');?></p>
> <p> Company: <?php echo $html->input('Emaildata/company',
> array('size'=>'60');?></p>
> <p> Your Email: <?php echo $html->textarea('Emaildata/email',
> array('size'=>'100');?></p>
>
> <p> <?php echo $html->submit('Save');?></p>
> </form>
> emaildatas_controler.php
> <?php
> class EmaildatasController extends AppController
> {
> var $name = "Emaildatas";
>
> function index(){
> $data = $this->Emaildata->findAll();
>
> //debug($this->Setting->findAll());
> //if ($data == "") print "Death!";
> $this ->set('emaildatas',$data);
> }
>
> function view($id){
> $this->Emaildata->emailId = $id;
> $this->set('emaildata', $this->Emaildata->read());
> }
> function add(){
> print_r($this->data);
> if(!empty($this->data['Emaildata'])){
> $this->Emaildata->save($this-data);
> $this-redirect('emaildatas/add/');
> }else{
> $this->render();
> }
> /* if($this->Emaildata->save($this->data['Emaildata'])){
> //send an confirmation email
> $this->flash('Thank you for registrating. You
> will receive a
> confirmation email shortly.','/emaildatas/');
> }
> }*/
> }
>
> }
>
> ?>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---