Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2. //Values from feed examples: 123, 234, 345
  3. $valuesFromFeed = array(123, 234, 345); //These are not in my code, they are values from the XML feed
  4.  
  5. while ($uniqueIdentifier = $valueFromFeed) {
  6. <input type="hidden" name="horse_<?php echo $uniqueIdentifier; ?>" />
  7. }
  8. ?>
  9.  
  10. <?php
  11. if (isset($_POST['horse_' . $uniqueIdetifier])) {
  12. echo "You got the right thing here.";
  13. } else {
  14. echo "Still no joy.";
  15. }
  16. ?>
  17.  
  18. <form action="/horses/my_unique_horse_name">
  19. ...
  20. </form>
  21.  
  22. <form action="/horses/another_horse_name">
  23. ...
  24. </form>
  25.  
  26. <form action="/horses/">
  27. <input type="hidden" value="my_unique_horse_name'>
  28. </form>
  29.  
  30. <form action="/horses/">
  31. <input type="hidden" value="another_horse_name'>
  32. </form>
  33.  
  34. <form method="/horses/">
  35. <button type="submit" value="my_unique_horse_name">My Horse</button>
  36. <button type="submit" value="another_horse_name">Another Horse</button>
  37. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement