Skip to content

Commit

Permalink
Fixed Form
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvramdev committed Jul 24, 2017
1 parent af796f6 commit 8352ce6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
6 changes: 4 additions & 2 deletions form_handler.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php
$field_name = $_POST['name'];
$field_email = $_POST['email'];
$field_message = $_POST['college'];
$field_college = $_POST['college'];
$field_no = $_POST['phone'];
$field_message = $_POST['message'];

$mail_to = '[email protected]';
$subject = 'Message from a site visitor '.$field_name;

$body_message = 'From: '.$field_name."\n";
$body_message .= 'E-mail: '.$field_email."\n";
$body_message .= 'Phone Number: '.$field_no."\n";
$body_message .= 'College: '.$field_message;
$body_message .= 'College: '.$field_college;
$body_message .= 'Message: '.$field_message;

$headers = 'From: '.$field_email."\r\n";
$headers .= 'Reply-To: '.$field_email."\r\n";
Expand Down
26 changes: 16 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -934,30 +934,36 @@ <h2 class="uppercase" style="text-align:center">Create Student Chapter of IOSD a
<div class="minimal-form">
<link href='https://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>

<form id="chapter-form">
<form id="chapter-form" action="form_handler.php" method="post">
<p>Hi,</p>
<p>We want to open a chapter of IOSD , my
<label for="your-name">name</label> is
<input type="text" name="your-name" id="chapter-name" minlength="3" placeholder="(your name here)"
required> and</p>
<label for="name">name</label> is
<input type="text" name="name" id="name" minlength="3" placeholder="(your name here)"
required>,</p>

<p>my
<label for="email">email address</label> is
<input type="email" name="your-email" id="chapter-email" placeholder="(your email address)"
<input type="email" name="email" id="email" placeholder="(your email address)"
required>
</p>
, </p>

<p> my
<label for="college">college </label> is
<input type="text" name="college" id="college" placeholder="(your college name)"
required> ,
</p>

<p> and my
<label for="email">college </label> is
<input type="email" name="your-email" id="chapter-college" placeholder="(your college name)"
<label for="college">phone number </label> is
<input type="number" name="phone" id="phone" placeholder="(your phone number)"
required>
</p>

<p> I have a
<label for="your-message">message</label> for you,</p>
<label for="message">message</label> for you,</p>

<p>
<textarea name="your-message" id="chapter-message" placeholder="(your msg here)"
<textarea name="message" id="message" placeholder="(your msg here)"
class="expanding"
required></textarea>
</p>
Expand Down

0 comments on commit 8352ce6

Please sign in to comment.