Submitting a book?

Success! Your book has been added to the database, check your homepage to see it.'; } elseif ($error == 'duplicate') { echo '

Looks like someone else is already working on this book, sorry about that. Please contact Marshall Poe if this seems to be an error.

'; } elseif ($error == 'sqlerror') { echo '

There seems to be an error with your request, please try again later.

'; } } ?>

Enter an ISBN below

It'll autofill the form below.

Enter it manually here

"; foreach($permissions as $channelID) { $row = mysqli_fetch_assoc(mysqli_query($conn, "SELECT channelName FROM channels WHERE channelID = ".$channelID."")); $channelName = $row['channelName']; $string = ""; $select = $select.$string; } $select = $select.""; if (isset($_POST['submit-isbn'])) { $isbn = $_POST['isbn-fetch']; $isbnLen = mb_strlen($isbn); if(!empty($isbn) && ($isbnLen == 10 || $isbnLen == 13)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, 'https://www.googleapis.com/books/v1/volumes?q=isbn:'.$isbn); $result = curl_exec($ch); curl_close($ch); $obj = json_decode($result, true); $title=$obj['items'][0]['volumeInfo']['title']; $author=$obj['items'][0]['volumeInfo']['authors'][0]; $publisher=$obj['items'][0]['volumeInfo']['publisher']; $publishingDate=$obj['items'][0]['volumeInfo']['publishedDate']; echo "
".$select."
"; } else { echo "
".$select."
"; } } else { echo "
".$select."
"; } ?>