I have this script tag , which takes the input from the user and passes it to the php block which is inside the same script tag and passes it to a URL and then fetches all the values , once all the values are fetched it then again uses javascript to print those values on the browser part without reload . So far I'am able to get the values from the URL and print it without reload , but that is when i initalize the value on the PHP url itself , all i want is to pass the javascript variable inside the php URL, so that whenever i write the keyword on the input box, it fetches the result.
Below is my script so far .
<script language="JavaScript">
function showInput() {
var aaa=document.getElementById('display').innerHTML = document.getElementById("user_input").value;
///alert(aaa);
<?php
$abc ='0545010225';
$xml = simplexml_load_file("http://lx2.loc.gov:210/lcdb?operation=searchRetrieve&recordSchema=marcxml&version=1.1&maximumRecords=10&query=bath.isbn%3D".$abc);
$xml->registerXPathNamespace("slim", "http://www.loc.gov/MARC21/slim");
$title = '/zs:searchRetrieveResponse/zs:records/zs:record[1]/zs:recordData/slim:record[1]/slim:datafield[@tag="245"]/slim:subfield[@code="a"]';
$result_title = $xml->xpath($title)[0];
$author = '/zs:searchRetrieveResponse/zs:records/zs:record[1]/zs:recordData/slim:record[1]/slim:datafield[@tag="100"]/slim:subfield[@code="a"]';
$result_author = $xml->xpath($author)[0];
$isbn = '/zs:searchRetrieveResponse/zs:records/zs:record[1]/zs:recordData/slim:record[1]/slim:datafield[@tag="020"]/slim:subfield[@code="a"]';
$result_isbn = $xml->xpath($isbn)[0];
?>
var t="<?php echo $result_title;?>";
var a="<?php echo $result_author;?>";
var i="<?php echo $result_isbn;?>";
}
</script>
All i am trying to do is pass the value of aaa
inside abc