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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:09:02+00:00 2026-06-13T13:09:02+00:00

I do not know if this is possible but on this page I have

  • 0

I do not know if this is possible but on this page I have this code below:

$moduleHTML  = "";  

 while($sqlstmt->fetch()) { 
    $moduleHTML .= "<option value='$dbModuleId'>" . $dbModuleId . " - " . $dbModuleName . "</option>".PHP_EOL;  
    $outputmodule = ""; 
        $outputmodule .= "<p><strong>Module:</strong> " . $dbModuleId .  " - "  . $dbModuleName . "</p>"; 
} 

But I want to echo the variable $outputmodule in another page. So below is the code for the other page which included the ajax which links the the script above (module.php) and where it contains the echo and where it contains part of the module drop down menu:

  <script type="text/javascript">

    function getModules() { 
    var course = jQuery("#coursesDrop").val(); 
    jQuery('#modulesDrop').empty(); 
    jQuery('#modulesDrop').html('<option value="">Please Select</option>'); 
    jQuery.ajax({ 
    type: "post", 
    url:  "module.php", 
    data: { course:course }, 
    success: function(response){ 
    jQuery('#modulesDrop').append(response); 
    } 
    }); 


    }


    </script> 

...

<?

$moduleHTML = "";  
$moduleHTML .= '<select name="modules" id="modulesDrop">'.PHP_EOL; 
$moduleHTML .= '<option value="">Please Select</option>'.PHP_EOL;  
$moduleHTML .= '</select>';

echo $outputmodule;

...

Problem is that I am receiving an undefined error for the echo above. My question is that how can I echo the $dbModuleId and $dbModuleName from the module.php page into the editsession.php page (script above)?

  • 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-06-13T13:09:03+00:00Added an answer on June 13, 2026 at 1:09 pm

    if you dont want to use sessions you could pass back your values as a json array then decode it and append your values with jquery

       $outputArray = array();  
    
         while($sqlstmt->fetch()) { 
            $outputArray['moduleHTML'] = "<option value='$dbModuleId'>" . $dbModuleId . " - " . $dbModuleName . "</option>".PHP_EOL;  
    
            $outputArray['outputModule']  = "<p><strong>Module:</strong> " . $dbModuleId .  " - "  . $dbModuleName . "</p>"; 
        } 
        echo json_encode($outputArray);
    

    Then on your page

    <script type="text/javascript">
    
    function getModules() { 
        var course = jQuery("#coursesDrop").val(); 
        jQuery('#modulesDrop').empty(); 
        jQuery('#modulesDrop').html('<option value="">Please Select</option>'); 
        jQuery.ajax({ 
            type: "post", 
            url:  "module.php", 
            data: { course:course }, 
            success: function(response){
                var outputjQuery.parseJSON(response)
                jQuery('#modulesDrop').append(output.moduleHTML); 
                jQuery('#outputModule').html(output.outputModule); 
           });
        }); 
    
    
    }
    
    
    </script> 
    
    ...
    
    <?
    
    $moduleHTML = "";  
    $moduleHTML .= '<select name="modules" id="modulesDrop">'.PHP_EOL; 
    $moduleHTML .= '<option value="">Please Select</option>'.PHP_EOL;  
    $moduleHTML .= '</select>';
    $moduleHTML .= '<div id="outPutModule"></div>;
    
    echo $moduleHTML;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is possible but I'm not really sure where to start. Has
I do not know if this is possible, but here goes. And working with
I'm not sure this is even possible but I know if it is, the
I know this is not programming related, but I have a scenario. Each video
I am not ever sure this is possible but I know you guys will
I'm wondering if there's a solution to this: (possibly not, but you never know!)
Go ahead and let me know if this is not possible: I need to
Okay, I know that 1) this is probably not possible with CSS alone and
I know this is not the only question out there, but I still couldn't
I have a webview that performs a search, this code works great for below

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.