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

  • Home
  • SEARCH
  • 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 7653631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:04:26+00:00 2026-05-31T12:04:26+00:00

I have an index.php with this code <div id=example class=functions></div> <script type=text/javascript> var ajax_load

  • 0

I have an index.php with this code

<div id="example" class="functions"></div> 
<script type="text/javascript">
var ajax_load = "<img class='loading' src='ajax-loader.gif' alt='loading...' />";
var loadUrl = "checks/example.php";
$("#example").load(loadUrl);
</script>

and in the checks/example.php file

$masterurl = $_POST['domain'];
echo $masterurl;

First Problem: the example.php can´t retrieve the $_POST Request, because ajax is outputting it like html. I have looked for JSON solutions – but not found anything for my problem.

Second Problem: if the index.php outputs the value from example.php, how can I take the value and from the and handle the value as another php variable? like

$value = [value from <div id="example"></div>]

UPDATE: First Problem resolved

<div id="example" class="functions"></div> 
<script type="text/javascript">
var ajax_load = "<img class='loading' src='ajax-loader.gif' alt='loading...' />";
var loadUrl = "checks/example.php?domain=http://www.example.com";
$("#example").load(loadUrl);
</script>


$masterurl = $_GET['domain'];
echo $masterurl;

but how can I take the value $masterurl in the index.php for a variable on the index.php?

UPDATE 2:
checks/example.php sends the following value = 35234 this value will be displayed in this div

<div id="example">35234</div>

how can I use this value on the same page for

<?php
$newvalue = "35234" // value from div id example
?>
  • 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-31T12:04:26+00:00Added an answer on May 31, 2026 at 12:04 pm

    That is an incorrect way to do make an request. .load() will only update the div with the returned value from the path, but does not help to send any data to the target.

    Make a valid post, or get, to request the page and update the <div> with the returned code

    $.post("checks/example.php", {
       varname : 'val', //send the data to the page using this format
       varname2 : 'value2'
    }, function(data) {
       // data will hold the output from the example.php
    
       $("#example").html(data); //update the div with the output
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have index.php like this: <script type=text/javascript src=jquery-1.4.2.js></script> <script type=text/javascript src=ajax.js></script> <a href='one.php' class='ajax'>One</a>
I have an index.php file that loads other php files via this javascript/ajax code:
I have sidebar.php in my views folder. It contains this code: <div class=title_box> Login
I have this code in my index.php. In Mozilla its ok. But in Ie
Currently my AJAX is working like this: index.php <a href='one.php' class='ajax'>One</a> <div id=workspace>workspace</div> one.php
index.php has this jquery code which loads notifications.inc.php into a div on the page
This is my code in index.php of the WordPress theme: <div id=content> <?php if
I have this code: <div id=menu> <ul> <li><span id=menulabel>Your Languages</span></li> <?php $hotClass = '';
I have a folder structure like this: /articles .index.php .second.php .third.php .fourth.php If I'm
I have tried to do this refering to following link. http://skypher.com/index.php/2008/07/28/function-list-for-php/ But no success.

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.