MySQL Forums
Forum List  »  PHP

Re: Convert JAVA variable into PHP variable
Posted by: Parker Shannon
Date: March 23, 2021 04:33AM

So I understand.

I have moved on, Peter, and found an HTML/PHP solution to my problem that doesn't involve JAVA.

Here is the web page: https://www.database39.com/stand.php

Naturally, the solution has created a new problem. I can't call the next page while the range slider is still running.

Code description -- everything works except call to NextPage.php:
1. Range slider
2. Get the value using PHP function
3. Validate (echo) I have the value in a PHP $variable
4. Call next page -- header('location:../NextPage.php');
Doesn't work while range slider is still running???

------------------------------------------------------
<!-- Begin Range Slider -->
<form action="" method="POST">
<div class="mt-4">
<input type="range" class="form-range" id="customRange" name="the_number" onchange='document.getElementById("bar").value = "Slider Value = " + document.getElementById ("foo").value;' width="66%" value="0" min="-100" max="100"/>
<div id="result"><b></b></div>
<input type="text" name="bar" id="bar" disabled />
<br />
<input type=submit value=Submit />
</form>
<br />
</center>

<!-- Get current value of slider -->
<?php
if(isset($_POST["the_number"])){
$the_number = $_POST["the_number"];
echo "Number of range is:" . $_POST["the_number"];
// Your Slider value is here, do what you want with it. Mail/Print anything..
} else{
Echo "Please slide the Slider Bar and Press Submit.";
}

// Validate number
echo "<br>";
echo "Hey! The number is --> ";
echo $the_number . "<br>";

// Load value of range slider into Session
$_SESSION['the_number'] = $the_number;

// ********* Turn the page -- THIS ISN'T WORKING! **********
header('location:../Stand2.php');
?>

Options: ReplyQuote


Subject
Written By
Posted
Re: Convert JAVA variable into PHP variable
March 23, 2021 04:33AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.