I´m trying to change product page inside a plugin that I´m developing but I have no idea what I´m doing wrong? I have tried to make a new curl request but from what I herd curl is not a thing in WP.

what I when to a accomplish is when the user selects a new page from a dropdown a new page appears.

                <div class="col-md-6x">
                <form action="" method="POST">
                     <div class="form-group">
                        <label for="comment">Select Page:</label>
                        <select class="form-control" name="pagecall" id="pagecall" style="width:75%;float:right;" onchange="davsele(this.value);">
                                $totalPage = $dataget['total'] / 20;
                                    $selc = ($getPageCount==$i)?'selected':'';
                                    echo "<option value=".$i." $selc>Page No. ".$i."</option>";
                        $(function() {
                              $('#pageBtn button').on('click', function() {
                                var index = $(this).index('#pageBtn button') + 1;
                                $('#pagecall option').eq( index ).prop('selected', true).parent().change();
                    <div id="pageBtn">

    function davsele(sval) {
      var xhttp = new XMLHttpRequest();
      xhttp.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
      xhttp.open("GET", "/api.php?value=" + sval, true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.