Skip to content

Instantly share code, notes, and snippets.

@rintoug
Created February 24, 2018 17:52
Show Gist options
  • Save rintoug/2fbade3140b753ae548bbb8ecf6804e0 to your computer and use it in GitHub Desktop.
Save rintoug/2fbade3140b753ae548bbb8ecf6804e0 to your computer and use it in GitHub Desktop.
How to Create a Contact Form In CodeIgniter
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../../../favicon.ico">
<title>Album example for Bootstrap</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
<body>
<div class="container" style="width:500px;margin:0 auto;">
<h2>Contact Form</h2>
<?php echo validation_errors('<div class="alert alert-danger" role="alert">', '</div>'); ?>
<form method="post">
<div class="form-group">
<label for="Firstname">Firstname</label>
<input type="text" class="form-control" id="Firstname" name="firstname" placeholder="Enter Firstname">
</div>
<div class="form-group">
<label for="Lastname">Lastname</label>
<input type="text" class="form-control" id="Lastname" name="lastname" placeholder="Enter Lastname">
</div>
<div class="form-group">
<label for="Email">Email</label>
<input type="email" class="form-control" id="Email" name="email" placeholder="Enter Email">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="Telephone">Telephone</label>
<input type="text" class="form-control" id="Telephone" name="telephone" placeholder="Enter Telephone">
</div>
<div class="form-group">
<label for="Comment">Comment</label>
<textarea name="comment" class="form-control" placeholder="Enter Comment"></textarea>
</div>
<button type="submit" class="btn btn-primary">Send</button>
</form>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment