Advertisement
Guest User

foodstore.php

a guest
Jan 10th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2. header('Content-Type: text/xml');
  3. echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
  4.  
  5. echo '<response>';
  6. $food = $_GET['food'];
  7. $foodArray = array('tuna','bacon','beef','loaf','ham');
  8. if(in_array($food, $foodArray))
  9. echo 'We do have'.$food.'!';
  10. elseif ($food=='')
  11. echo 'Enter a food you idiot';
  12. else
  13. echo 'Sorr fucker we dont sell no'.$food.'!';
  14. echo '</response';
  15.  
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement