comparison php/read/saveUserList.php @ 6:077b0a0a3e6d

remaining originals according to dependency walk
author Robert Boland <robert@markup.co.uk>
date Thu, 16 Feb 2017 22:29:02 +0000
parents
children 385ddd7c4b55 a67bf725e87b
comparison
equal deleted inserted replaced
5:55445b456ad0 6:077b0a0a3e6d
1 <?PHP
2
3 if( !empty($_POST) ){
4
5 include "../../../private/db.php";
6
7 //echo $_POST["xml"];
8 //echo print_r($_POST);
9 $xml = new SimpleXMLElement(stripslashes($_POST["xml"]));
10
11 $userID = $xml->UserID;
12 //echo $userID;
13
14 $listName = stripslashes($xml->List->SavedListName);
15 //echo $listName;
16
17 for($i=0;$i<sizeof($xml->List->ListDetails->Book);$i++){
18 $isbn = $xml->List->ListDetails->Book[$i]->ISBN;
19 $picURL = $xml->List->ListDetails->Book[$i]->PictureURL;
20 $title = stripslashes($xml->List->ListDetails->Book[$i]->BookTitle);
21
22 //echo "$isbn,$picURL,$title-";
23 $add = "CALL b_insertSaveList($userID,\"$listName\",\"$isbn\",\"$picURL\",\"$title\")"; //"insert into usersave values(null,$userID,\"$listName\",'$isbn','$picURL',\"$title\",1)";
24 echo $add;
25 $run = mysqli_query($link, $add); //add the book to the list in usersave
26 }
27 }
28 else
29 {
30 echo "Empty Post";
31 }
32
33 ?>