PHP 22
Zek By Guest on 24th March 2017 06:43:03 AM
  1. <?php
  2.  
  3.         $escaped_party_size=htmlspecialchars(1, ENT_QUOTES, 'UTF-8');
  4.         $escaped_adults=htmlspecialchars((int)5, ENT_QUOTES, 'UTF-8');
  5.         $escaped_children=htmlspecialchars((int)5, ENT_QUOTES, 'UTF-8');
  6.  
  7.  echo " PARTY SIZE: $escaped_party_size - ESC ADULTS: $escaped_adults  -  ESC CHILDREN: $escaped_children  END " ;
  8.  
  9.         $party_size = (int)$escaped_party_size;
  10.         $adults_number = (int)$escaped_adults;
  11.         $children_number = (int)$escaped_children;
  12.         $result = "";
  13.  
  14.         if( $party_size == 1 )
  15.         {
  16.               $result =  ($adults_number * 40) + ($children_number * 30);
  17.            
  18.         }
  19.         else if(party_size == 2){
  20.        
  21.              $result = ($adults_number * 30) + ($children_number * 20);
  22.         }
  23.         else if(party_size == 3){
  24.        
  25.              $result = ($adults_number * 25) + ($children_number * 15);
  26.         }
  27. /// send mail
  28.  echo 'Price :' .$result. "\r\n" ;
  29.  
  30.  
  31. $vals = "PARTY-SIZE POST: {$_POST[party-size]} - GET:  {$_GET[party-size]} \r\n ".
  32.         "ADULTS POST: {$_POST[adults]} - GET:  {$_GET[adults]} \r\n ".
  33.         "CHILDREN POST: {$_POST[children]} - GET:  {$_GET[children]} \r\n " ;
  34.        
  35.  
  36.  
  37. ?>

Paste is for source code and general debugging text.

Login or Register to delete or keep track of your pastes.