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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:32:15+00:00 2026-06-07T04:32:15+00:00

Why I do not get any printing on the screen (m1, m2 or m3)?

  • 0

Why I do not get any printing on the screen (m1, m2 or m3)?

i.e. how can I pass JavaScript var to PHP Session.

<?php session_start(); ?>

<html>
<head>

<script type="text/javascript">
function disp_text()
   {
      var p = document.myform.mylist.value;
      <?php $_SESSION['color'] ?> = p;
      <?php echo $_SESSION['color'] ?>;
   }
</script>

</head>
<body>

<FORM NAME="myform">
<SELECT NAME="mylist" onChange="disp_text()">
<OPTION VALUE="m1">Red
<OPTION VALUE="m2">Blue
<OPTION VALUE="m3">Green
</SELECT>
</FORM>

Thanks for any help.

  • 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-07T04:32:16+00:00Added an answer on June 7, 2026 at 4:32 am

    And another one for the count… JavaScript runs on the user’s computer, PHP runs on the server. View the page source (right-click, View Source) and you will see exactly why it doesn’t work:

    <script type="text/javascript">
    function disp_text()
       {
          var p = document.myform.mylist.value;
          = p;
          ;
       }
    </script>
    

    The only way to get JS variables into PHP is via a form (which I am using loosely to include AJAX).

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

Sidebar

Related Questions

HEllo , i can not find any way to get horizontal or/and vertical resolution
I do not get any error here but i am failing to display anything
After searching a lot i did not get any answers and finally i had
i tried to search this but was not able to get any proper help.I
I tried the following code. Although I don't get any errors, it did not
I'm not able to get this persistence file correct... I do not find any
Is there any way to get a TextBox in j2me not editable? Because I
I get no errors but my code is not saving any new data to
In the following I the get the error IndentationError: unindent does not match any
I simply can not get Visual Studio 2005 to find the System.Configuration.ConfigurationManager class. Here

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.