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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:56:14+00:00 2026-05-22T15:56:14+00:00

Suppose I have a page called view.php, if I give an argument like view.php?q=fruit,

  • 0

Suppose I have a page called view.php, if I give an argument like view.php?q=fruit, it creates a list of fruits stored in an array. I want change the content of a label in a page to be changed to the content of that array if a slider in that page changes. In the example above, this array contains: $list = array('banana', 'apple', 'orange'); I want to have a slider in the page and a lable that when the user changes the slider’s value, the label’s text changes to ‘banana’, ‘apple’, …
I heard aboue sessions in PHP but since there may be lots of calls to this page in multiple tabs, I think this wouldn’t be a good idea. How can I do this?

Thanks in advance.

  • 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-22T15:56:15+00:00Added an answer on May 22, 2026 at 3:56 pm

    OK. I found what I wanted. I found a pretty neat slider here:
    http://jqueryui.com/demos/slider/

    then I used in in my page like this:

    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="utf-8">
            <title>jQuery UI Slider - Snap to increments</title>
            <link type="text/css" href="jquery/slider.css" rel="stylesheet" />    
            <script src="jquery/jquery-1.6.1.js"></script>
            <script src="jquery/jquery-ui-1.8.13.custom.min.js"></script>
    
    
            <?php 
    
                $list = array('apple','orange','banana');
    
            ?>
    
            <script>
                var arrayFromPHP = <?php echo json_encode($list) ?>;
                $(function() {
                    $( "#slider" ).slider({
                        value:1,
                        min: 0,
                        max: arrayFromPHP.length - 1,
                        step: 1,
                        slide: function( event, ui ) {
                            $( "#amount" ).val(arrayFromPHP[ui.value]);
                        }
                    });
                    $( "#amount" ).val( arrayFromPHP[$( "#slider" ).slider( "value" )] );
                });
            </script>
        </head>
        <body>
    
            <div class="demo">
    
                <p>
                    <label for="amount">Current selection:</label>
                    <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
                </p>
    
                <div id="slider"></div>
    
            </div>
        </body>
    </html>
    

    Please note that I used Rob’s answer as my source and all the credit’s go to him. But since it was not EXACTLY what I wanted, I decided to post my own answer.

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

Sidebar

Related Questions

Suppose I have one html page with frames. The left frame is simply a
Suppose I have the following CSS rule in my page: body { font-family: Calibri,
Let's suppose I have an applet running within a page in a browser. What
I'm using Ajax to dynamically populate a DIV. I have each page content stored
I have a web page that contains a div element called #order_details that is
I have a page that is supposed to launch the Print Preview page onload.
Suppose you have 2 different ASP.NET applications in IIS. Also, you have some ASCX
Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new
Suppose we have a table A: itemid mark 1 5 2 3 and table
Suppose I have a class module clsMyClass with an object as a member variable.

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.