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 1027207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:12:21+00:00 2026-05-16T12:12:21+00:00

I have some content on my page that I require to be loaded via

  • 0

I have some content on my page that I require to be loaded via ajax. The page that I want to load is requesting some php variables I have stored on the main page.

How can I send these variables to the page then load the page via ajax?

Code so far:

$('#microblogposts').load('posts.php', {postmessage: "+ postmessage +"& from_user: "+ from_user +"& from_username: "+ from_username  });

Is there a better more efficient way to do this?

  • 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-16T12:12:22+00:00Added an answer on May 16, 2026 at 12:12 pm

    // Main Page say main.php

    <?php  
          $postmessage = "msg"; 
          $from_user = "ayaz" 
     ?>
     <script>
           var pm  = <?php echo $postmessage; ?>
           var fu = <?php echo $from_user; ?>
           $(function(){
                $.post("posts.php",{postmessage: pm, from_user: fu}, function(data){
                    $('#microblogposts').html(data):    
                });
           });
     </script>
    

    This code might give you idea to implement in your scenario.

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

Sidebar

Related Questions

I have a page that loads content through AJAX. Among this content are some
I have some page layouts that require multiple columns and all of their content
I have some content that I want to appear on multiple pages of my
I have some content that I am loading using jquery ajax. The content has
I have an application that requires to use QWebView::setContent() to load some HTML content
I have some content I want to show in iframe with fancybox. When I
I'm doing some in browser editing, and I have some content that's on the
Hey guys I simply cannot get this to work. I have some content that
I have sections on a page that require a fair amount of resources that
I have used hpricot before for grabing content from websites that are within some

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.