Advertisement
Guest User

Untitled

a guest
May 28th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['x'])){
  3. $validbogie = false;
  4. //validate password
  5. if(($_POST['number_of_bogies']) >0 && ($_POST['number_of_axles']) >1){
  6. if($_POST['number_of_bogies'] < $_POST['number_of_axles']){
  7. $validbogie = true;
  8. }elseif($_POST['number_of_bogies'] == $_POST['number_of_axles']){
  9. echo "You can't have the same ammount of bogies and axles!";
  10. }
  11. else{
  12. echo "You can't have more bogies than axles!." . "<br>";
  13. }
  14. }else{
  15. echo "Please fill in the number of axles and bogies!" . "<br>";
  16. }
  17.  
  18. //If email & passwords are valid, then create new user.
  19. if($validbogie){
  20. $train_name = $_POST['train_name'];
  21. $tare_weight = $_POST['tare_weight'];
  22. $number_of_bogies = $_POST['number_of_bogies'];
  23. $number_of_axles = $_POST['number_of_axles'];
  24. $wheel_diameter_minimal = $_POST['wheel_diameter_min'];
  25. $wheel_diameter_maximal = $_POST['wheel_diameter_max'];
  26. //$country = $_POST['country_id'];
  27. $id = $database->edit_train_info($train_name, $tare_weight, $number_of_bogies, $number_of_axles, $wheel_diameter_minimal, $wheel_diameter_maximal);
  28. unset($_POST['x']);
  29. echo "done!";
  30. }
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement