Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. $keyword = trim($_GET["Keyword"]);
  2. if (!empty($keyword)) {
  3. $if_statement = ($keyword == $Product->keyword);
  4. }
  5.  
  6. $shopByStore = $_GET["store"];
  7. if (!empty($shopByStore)) {
  8. $if_statement = ($if_statement && $shopByStore == $Product->store);
  9. }
  10.  
  11. // plus 7 more GET methods retrieving potential user input for the $if_statement variable.
  12.  
  13. $XMLproducts = simplexml_load_file("products.xml");
  14. foreach($XMLproducts->product as $Product) {
  15.  
  16. if ($if_statement) { // the problem lies here
  17. echo $Product->name;
  18. }}
  19.  
  20. if($Product->something) {} //this is meaningless and will throw and error
  21. //if you define $Product->something here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement