Commit 314e902d by yuward

setting for reload page and login

parent 4b4fca48
<?php <?php
if (file_exists('dbconnect.php')) { if (file_exists('dbconnect.php')) {
require('dbconnect.php'); require('dbconnect.php');
if (mysqli_connect_error()) { if (mysqli_connect_error()) {
die('Connect Error (' . mysqli_connect_errno() . ')' . mysqli_connect_error()); die('Connect Error (' . mysqli_connect_errno() . ')' . mysqli_connect_error());
} }
} }
//Add function files //Add function files
require('options.php'); require('options.php');
if (file_exists('../includes/functions.php')) { if (file_exists('../includes/functions.php')) {
...@@ -159,15 +161,15 @@ function length_options(){ ...@@ -159,15 +161,15 @@ function length_options(){
<!-- calculator input and output--> <!-- calculator input and output-->
<!--Add function to recieve number, <!--Add function to recieve number,
Be able to input number from either box.--> 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> <label for="input" class="Input-label">Your Entry</label>
<select name="from_unit"> <select id="from_unit"name="from_unit">
<?php echo length_options(); ?> <?php echo length_options(); ?>
</select> </select>
<br> <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> <label for="input" class="input-label">Converted result</label>
<select name="to_unit"> <select id = "to_unit" name="to_unit">
<?php echo length_options(); ?> <?php echo length_options(); ?>
</select> </select>
......
...@@ -7,3 +7,17 @@ function closeSlideMenu(){ ...@@ -7,3 +7,17 @@ function closeSlideMenu(){
document.getElementById('side-menu').style.width = '0'; document.getElementById('side-menu').style.width = '0';
document.getElementById('main').style.marginLeft = '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){ ...@@ -69,7 +69,6 @@ function protect($string){
var username = $("#username").val(); var username = $("#username").val();
var email = $("#email").val(); var email = $("#email").val();
var password = $("#password").val(); var password = $("#password").val();
var continue = $("#continue").val();
if (email.length == 0 || password.length == 0 || username.length == 0) if (email.length == 0 || password.length == 0 || username.length == 0)
alert('Please check input'); alert('Please check input');
else{ 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