Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7517185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:21:59+00:00 2026-05-30T01:21:59+00:00

Here I have a two files. One for forms and second php for getting

  • 0

Here I have a two files. One for forms and second php for getting results…

PHP file:

$site=$_GET['textfield1']
$xpathfromform=$_GET['textfield2']


$dom = new DOMDocument();
@$dom->loadHTMLFile($site);
$xpath = new DOMXPath($dom);
$result = $xpath->query($xpathfromform)->item(0)->textContent;

second file is a form:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<label>Enter URL address here: 
<input name="textfield" type="text" value="http://www." />
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
<br />
<br />
Enter xpath location of element:
<input type="text" name="textfield2" />
<input type="submit" name="Submit2" value="Submit" />
<br />
<br />
Selected element is: </label>
<p>&nbsp;</p>
</body>
</html>

How to connect this two files with JSON…
example what I need:

1st. type URL and then xpath and click on submit
2nd. when I click I need to start .php file to get result
3th. I must get $result from php file and show in my first file …

How to connect this two files with json ??? or something else.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:22:02+00:00Added an answer on May 30, 2026 at 1:22 am

    Man, you need to do questions with a bit more sense O.o

    So, are you trying to make an AJAX request to your php “file” when the submit button is pressed?

    If yes, follow these steps:

    1. Add a listener to the submit event for you form $(form).submit(ajaxSubmit) when ajaxSubmit is a function that will receive an event as parameter
    2. In ajaxSubmit will be some steps:

      • Make sure that the default event (form submit) will not happens event.preventDefault()
      • If you need, validate the form fields.
      • Serialize your fields and call $.ajax with your parameters and handling a success function
    3. The ajax success function, get the result and write it into some element on form page.

    So, see an example of ajax form submit and handling JSON response

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created two simple files in php. first file (i.e. input.php ): Created
I have two files, one containing an array in PHP that is echo ed
What is the issue with this code? Here we have two files: classA.h and
i have the form, and i want to upload two files. here is the
here is what my code looks like i have two forms: class Form_1 extends
I have two layouts(xml files) and I want to flip from one page to
I have a program that takes two files as an argument. The first file
Here's the thing: I have two applications, written in C++ and running on two
Here is the scenario: I have two asp pages. a.aspx is layout and b.aspx
I have two tables: entitytype and project . Here are the create table statements:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.