• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
email

#1
[eluser]diasansley[/eluser]
plz check the code for syntax and stuff

the view
Code:
<html>
<head>


<input type="submit" value="Send">

<?php form_open('email/send1');?>
</head>
</html>


the controller
Code:
<?php

Class Email extends Controller{

function _construct(){
     parent::Controller();
$this->load->library('email');
$this->load->helper('form');
        }

function index(){
$this->load->view('email_view.php');

       }

function send1(){

$this->email->from('[email protected]', 'DA');
$this->email->to('[email protected]');

$this->email->subject('Email Test');
$this->email->message('Testing the email class.');    

$this->email->send();

echo $this->email->print_debugger();
         }
     }
?>

when i click on send nothin happens...

Help would be appreciated

Thanks

#2
[eluser]InsiteFX[/eluser]
Code:
<html>
<head>

<?php echo form_open('email/send1');?>
<input type="submit" value="Send">
<?php echo form_close();?>

</head>
</html>

InsiteFX

#3
[eluser]diasansley[/eluser]
there is no action performed on "send" button i tried puting an echo there was no output!



Thanks rgds

#4
[eluser]jpijper[/eluser]
Put the form in the body.

#5
[eluser]diasansley[/eluser]
done still nothing...... works

#6
[eluser]dudeami0[/eluser]
Code:
<html>
<head>
   <title>Form Test</title>
</head>
<body>

<?php form_open('email/send1');?>
<input type="submit" value="Send" name="send" />
<?php form_close(); ?>

</body>
</html>

Make sure everything is configured in application/config/config.php, mainly URL related things. For testing the submit, try:

Code:
<?php

Class Email extends Controller {

   function __construct(){
      parent::Controller();
      $this->load->library('email');
      $this->load->helper('form');
   }

   function index(){
      $this->load->view('email_view.php');
   }

   function send1(){
      echo "Form was processed " . ($this->input->post('send') !== false ? "successfully" : "unsuccessfully");
   }
}
?>

Also note its __construct with 2 underscores.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.