Skip to content

Commit

Permalink
Update cgi_test.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
arfhad-shaikh committed Jul 29, 2021
1 parent 1a95630 commit a320ea0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cgi/cgi_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
$data{firstname} =$query->param('firstname');
$data{firstname}=~s/(<([^>]+)>)/""/ig;
$data{lastname} = $query->param('lastname');
$data{lastname}=~s/(<([^>]+)>)/""/ig;
$data{email} = $query->param('email');
$data{email}=~s/(<([^>]+)>)/""/ig;
#$data{country} = $query->param('country');
#$data{psw} = $query->param('psw');
#$data{psw_repeat} = $query->param('psw_repeat');
Expand All @@ -38,10 +40,10 @@
<p>Please fill in the details to find your BMI.</p>
<hr>
<label for="Height">Height</label>
<input type="text" id="height" name="height" placeholder="Your height in cm ..">
<input type="text" id="height" name="height" pattern="[0-9].{,3}" placeholder="Your height in cm ..">
<label for="weight">Weight</label>
<input type="text" id="weight" name="weight" placeholder="Your weight in kg..">
<input type="text" id="weight" name="weight" pattern="[0-9].{,3}" placeholder="Your weight in kg..">
<button type="submit" class="signupbtn" onclick="calculateBMI()">Calculate BMI</button>
Expand All @@ -52,8 +54,11 @@
HTML

print <<HTML;
<script language="JavaScript">
var email="$data{email}"
var email="$data{email}";
function calculateBMI() {
var weight = document.getElementById("weight").value;
var height = document.getElementById("height").value;
Expand Down

0 comments on commit a320ea0

Please sign in to comment.