Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
I want to retrive data in tabular form using ajax and php

I have written the following code

<!DOCTYPE html>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-    scale=1.0">
        <title>contact.dat</title>
      <body>
      <div id="demo">
    <h2>Retrive data by ajax</h2>
    <button type="button" onclick="printdata()">Retrive data</button>
    </div>
    
    <script>
    function printdata() {
      const xhttp = new XMLHttpRequest();
      xhttp.onload = function() {
        document.getElementById("demo").innerHTML +=this.responseText;
      }
      xhttp.open("GET", "contact.dat");
      xhttp.send();
    }
    </script>
      </body>
    
    <?php
    
    $fp = fopen('contact.dat', 'r');
    echo "<table border=1>";
    echo "<tr><th>Sr. No.</th><th>Name</th><th>Residence No.</th><th>Mob.
    no.</th><th>Address</th></tr>";
    while ($row = fscanf($fp, "%s %s %s %s %s")) {
        echo "<tr>";
        foreach ($row as $r) {
            echo "<td>$r</td>";
        }
        echo "</tr>";
    }
    echo "</table>";
    fclose($fp);
    ?>
    
    </html>

its showing me this output I want to show data when I click on the button. I'm new in both JavaScript as well as PHP. is there any way to perform something like

if(isset(printdata();))

then run php code block???

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Here lies the wrong

/usr/bin/env /opt/jdk17/bin/java .... java.ASG6Ba 

Probably the file that you try to execute is ASG6Ba.java.

The provided file java.ASG6Ba with the ending ASG6Ba makes no sense for java to be executed.

Also java is a prohibited name for packages in java and since the file provided is java.ASG6Ba, java thinks that java is a package name and then follows the class name ASG6Ba. This is the specific reason the error is thrown.

Prohibited package name: java

This is also described in java documentation in chapter 6.1

The first component of a package or module name must not be the identifier java. Package and module names that start with the identifier java are reserved for packages and modules of the Java SE Platform

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!