Commit 314e902d by yuward

setting for reload page and login

parent 4b4fca48
<?php
if (file_exists('dbconnect.php')) {
require('dbconnect.php');
if (mysqli_connect_error()) {
die('Connect Error (' . mysqli_connect_errno() . ')' . mysqli_connect_error());
}
}
//Add function files
require('options.php');
if (file_exists('../includes/functions.php')) {
......@@ -159,15 +161,15 @@ function length_options(){
<!-- calculator input and output-->
<!--Add function to recieve number,
Be able to input number from either box.-->
<input id="Input" class="Input-text" placeholder="Enter amount" name="from_value" value="<?php echo $from_value; ?>" />&nbsp; <label for="Input" class="Input-label">Your entry</label>
<input id="from_value" class="Input-text" placeholder="Enter amount" name="from_value" value="<?php echo $from_value; ?>" />&nbsp; <label for="Input" class="Input-label">Your entry</label>
<label for="input" class="Input-label">Your Entry</label>
<select name="from_unit">
<select id="from_unit"name="from_unit">
<?php echo length_options(); ?>
</select>
<br>
<input id="Input" class="Input-text" placeholder="Wait for it" name="to_value" value=" <?php echo $to_value; ?>" />&nbsp;
<input readonly id="Input" class="Input-text" placeholder="Wait for it" name="to_value" value=" <?php echo $to_value; ?>" />&nbsp;
<label for="input" class="input-label">Converted result</label>
<select name="to_unit">
<select id = "to_unit" name="to_unit">
<?php echo length_options(); ?>
</select>
......
......@@ -6,4 +6,18 @@ function openSlideMenu(){
function closeSlideMenu(){
document.getElementById('side-menu').style.width = '0';
document.getElementById('main').style.marginLeft = '0';
}
function checkForm(){
var from_unit = document.getElementById("from_unit").value;
var to_unit = document.getElementById("to_unit'").value;
var from_value = document.getElementById("from_value").value;
var to_value = document.getElementById("to_value").value;
//
if (isNaN(num1)){
document.w
}
document.getElementById("myForm").submit();
}
\ No newline at end of file
<?php
$from_value = $_POST['from_value'];
$from_unit = $_POST['from_unit'];
$to_unit = $_POST['to_unit'];
if (is_numeric(($from_unit))){
echo "Must be a digit";
};
?>
......@@ -69,7 +69,6 @@ function protect($string){
var username = $("#username").val();
var email = $("#email").val();
var password = $("#password").val();
var continue = $("#continue").val();
if (email.length == 0 || password.length == 0 || username.length == 0)
alert('Please check input');
else{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment