SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. header('Content-type: application/xml');
  3.  
  4. include('../index/sql.php'); // connect stb
  5. require_once('../index/eleje.php'); //munkamenet indítás
  6. $firstarray = explode(',',$_GET['products']);
  7. $secondarray = array();
  8. foreach ($firstarray as $one){
  9.   $secondarray[] = '"'.mysql_real_escape_string($one).'"'; // sql injection kivedes
  10. }
  11. $part = implode(',',$secondarray);
  12. $q = mysql_query('SELECT * FROM termek WHERE kod IN ('.$part.')');
  13. print "<?xml version=\"1.0\"?>\n";
  14. print "<products>\n";
  15. while($r = mysql_fetch_array($q)){
  16.   print "\t<product>\n";
  17.   print "\t\t<productid>".$r['kod']."</productid>\n";
  18.   print "\t\t<productname>".($r['rnev']?$r['rnev']:$r['nev'])."</productname>\n";
  19.   print "\t\t<productprice>".($r['euro']?$r['ar']*305:$r['ar'])."</productprice>\n";
  20.   print "\t</product>\n";
  21. }
  22. print "</products>\n";
  23. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top