Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['x'])){
- $validbogie = false;
- //validate password
- if(($_POST['number_of_bogies']) >0 && ($_POST['number_of_axles']) >1){
- if($_POST['number_of_bogies'] < $_POST['number_of_axles']){
- $validbogie = true;
- }elseif($_POST['number_of_bogies'] == $_POST['number_of_axles']){
- echo "You can't have the same ammount of bogies and axles!";
- }
- else{
- echo "You can't have more bogies than axles!." . "<br>";
- }
- }else{
- echo "Please fill in the number of axles and bogies!" . "<br>";
- }
- //If email & passwords are valid, then create new user.
- if($validbogie){
- $train_name = $_POST['train_name'];
- $tare_weight = $_POST['tare_weight'];
- $number_of_bogies = $_POST['number_of_bogies'];
- $number_of_axles = $_POST['number_of_axles'];
- $wheel_diameter_minimal = $_POST['wheel_diameter_min'];
- $wheel_diameter_maximal = $_POST['wheel_diameter_max'];
- //$country = $_POST['country_id'];
- $id = $database->edit_train_info($train_name, $tare_weight, $number_of_bogies, $number_of_axles, $wheel_diameter_minimal, $wheel_diameter_maximal);
- unset($_POST['x']);
- echo "done!";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement