What is the alternative of html form in php? -


i sending email when user post data using form. condition sending email

    <?php if($_server["request_method"] == "post") {  $message='thanks registerring yourself';     require "public/api/phpmailer/class.phpmailer.php"; //include phpmailer class      // instantiate class       $mail = new phpmailer();        // set smtp       $mail->issmtp();                // sets smtp connection       $mail->smtpauth = true;         // connection smtp require authorization         $mail->smtpsecure = "ssl";      // connect using tls connection       $mail->host = "smtp.gmail.com";  //gmail smtp server address     $mail->port = 587;  //gmail smtp port     $mail->smtpsecure = "tls";      $mail->smtpdebug = 1;      $mail->encoding = '7bit';      // authentication       $mail->username   = '*********'; // full gmail address     $mail->password   = '*********'; // gmail password      // compose     $email = $_post['inputemail'];     $mail->msghtml($message);      // send       $mail->addaddress($email, "rahulname"); // send - recipient     $result = $mail->send();        // send!       $message = $result ? 'successfully sent!' : 'sending failed!';           unset($mail);  } ?> 

form declaration .when m using this,i able send email form data not going in database.

  <form method="post" id="login_form" action="" > 

but when m using m able send data in database not email.

<?php echo form_open_multipart('upload/do_upload');?>  

what solution both things ?

i assume using codeigniter.

for question equivalent html code is

<form enctype="multipart/form-data" method="post" id="login_form" action="">

you should refer ci's user guide ci form helper

as @ source code of helper file: source code - formhelper

hope helps.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -