Hi Guys you can use very simple
1. if you instal (IC)
.
Then you 1st Create A tabel in data base
CREATE DATABASE oktech_courses; CREATE TABLE contact( id int(10) NOT NULL AUTO_INCREMENT, Name varchar(255) NOT NULL,
Phone int(15) NOT NULL,
City varchar(255) NOT NULL, Email varchar(255) NOT NULL,
Message text(255) NOT NULL, Date timestamp(255) NOT NULL, PRIMARY KEY (Student_id) )
connect database to you file then
Then you go the controller and open file welcome.php
$this->load->helper(array('form','url','validate_helper','image_helper')); $this->load->library(array('email','session','form_validation'));
Insert the text:
>> public function filename contect()
{
$this->load->view('Contect');
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public function contact(){ $this->load->view('contact'); }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public function contact_form(){ $input=$this->input->post(); Validation Satart if(!empty($input)) { require_validations(['name','phone','city','email','message'],'','CI','Welcome/contact'); $result=$this->courses_model->contact_form($input); if($result==true) { $to='vinaykumar.vismaad@gmail.com'; $subject='Contact-US Enquiry'; $message='Email : '.$input['email'].'<br> '.'Name :'.$input['name'].'<br>'.'phone :'.$input['phone'].'<br>'.'city :'.$input['city'].'<br>'.'message :'.$input['message']; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= 'From: oketch-courses<info@oketch-courses.com>' . "\r\n" . 'Reply-To: no-reply@oketch-courses.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $sta_email=mail($to,$subject,$message,$headers); $this->session->set_flashdata('success','Contact form Successfully submit.'); } else { $this->session->set_flashdata('error','Unable to Submit Contact form.'); } redirect('Welcome/contact'); } else { redirect('Welcome/contact'); } }
Validation End
you can change the contact name acording your file.
$input >> Store the all value in variable
><>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<div class="container"> <div class="overlay-contact footer-part footer-part-form"> <div class="map-head"> <p>Send Us Now</p> <h2>GetIn Touch</h2> <span class="footer-ser-re">Service Request Form</span> </div> <!-- ENQUIRY FORM -->
Validation
<?php if(!empty($this->session->flashdata('error'))){ ?> <div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <i class="fa fa-times-circle"></i> <?php echo $this->session->flashdata('error'); ?> </div> <?php } ?> <?php if(!empty($this->session->flashdata('success'))){ ?> <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <i class="fa fa-times-circle"></i> <?php echo $this->session->flashdata('success'); ?> </div> <?php } ?>
<form method="post" action="<?php echo base_url(); ?>/Welcome/contact_form">
<ul>
<li class="col-md-6 col-sm-6 col-xs-12 contact-input-spac">
<input type="text" id="f1" value="" name="name" placeholder="Name" >
<span class="error_val"><?php echo $this->session->flashdata('name'); ?></span>
</li>
<li class="col-md-6 col-sm-6 col-xs-12 contact-input-spac">
<input type="text" id="f2" value="" name="phone" placeholder="Phone" >
<span class="error_val"><?php echo $this->session->flashdata('phone'); ?></span>
</li>
<li class="col-md-6 col-sm-6 col-xs-12 contact-input-spac">
<input type="text" id="f3" value="" name="city" placeholder="City">
<span class="error_val"><?php echo $this->session->flashdata('city'); ?></span>
</li>
<li class="col-md-6 col-sm-6 col-xs-12 contact-input-spac">
<input type="email" id="f4" value="" name="email" placeholder="Email">
<span class="error_val"><?php echo $this->session->flashdata('email'); ?></span>
</li>
<li class="col-md-12 col-sm-12 col-xs-12 contact-input-spac">
<textarea id="f5" name="message" ></textarea>
<span class="error_val"><?php echo $this->session->flashdata('message'); ?></span>
</li>
<li class="col-md-6">
<input type="submit" value="SUBMIT"> </li>
</ul>
</form>
</div>
</div>
1. if you instal (IC)
.
Then you 1st Create A tabel in data base
CREATE DATABASE oktech_courses; CREATE TABLE contact( id int(10) NOT NULL AUTO_INCREMENT, Name varchar(255) NOT NULL,
Phone int(15) NOT NULL,
City varchar(255) NOT NULL, Email varchar(255) NOT NULL,
Message text(255) NOT NULL, Date timestamp(255) NOT NULL, PRIMARY KEY (Student_id) )
connect database to you file then
Then you go the controller and open file welcome.php
$this->load->helper(array('form','url','validate_helper','image_helper')); $this->load->library(array('email','session','form_validation'));
Insert the text:
>> public function filename contect()
{
$this->load->view('Contect');
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
public function contact(){ $this->load->view('contact'); }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
public function contact_form(){ $input=$this->input->post(); Validation Satart if(!empty($input)) { require_validations(['name','phone','city','email','message'],'','CI','Welcome/contact'); $result=$this->courses_model->contact_form($input); if($result==true) { $to='vinaykumar.vismaad@gmail.com'; $subject='Contact-US Enquiry'; $message='Email : '.$input['email'].'<br> '.'Name :'.$input['name'].'<br>'.'phone :'.$input['phone'].'<br>'.'city :'.$input['city'].'<br>'.'message :'.$input['message']; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= 'From: oketch-courses<info@oketch-courses.com>' . "\r\n" . 'Reply-To: no-reply@oketch-courses.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $sta_email=mail($to,$subject,$message,$headers); $this->session->set_flashdata('success','Contact form Successfully submit.'); } else { $this->session->set_flashdata('error','Unable to Submit Contact form.'); } redirect('Welcome/contact'); } else { redirect('Welcome/contact'); } }
Validation End
you can change the contact name acording your file.
$input >> Store the all value in variable
><>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Contact.php
<div class="container"> <div class="overlay-contact footer-part footer-part-form"> <div class="map-head"> <p>Send Us Now</p> <h2>GetIn Touch</h2> <span class="footer-ser-re">Service Request Form</span> </div> <!-- ENQUIRY FORM -->
Validation
<?php if(!empty($this->session->flashdata('error'))){ ?> <div class="alert alert-danger alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <i class="fa fa-times-circle"></i> <?php echo $this->session->flashdata('error'); ?> </div> <?php } ?> <?php if(!empty($this->session->flashdata('success'))){ ?> <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <i class="fa fa-times-circle"></i> <?php echo $this->session->flashdata('success'); ?> </div> <?php } ?>
Validation
form
*Note : Welcome/contact_form You can change name which you create file name in welcome page
* Contact_forme Taken By welcome to function you can check the welcome.php page.
*Note :
This scentex use when you give a temprory data story
and you get better result
...When you create a forme the clic submit button
then show the data "submit" if error the page redirect
same page or 1 time use if you reload page then it
erase the success data note.
<input type="email" id="f4" value="" name="email" placeholder="Email">
0 comments:
Post a Comment
Thanks