Hi Sirs;
$receivedValue = "";
if (isset($_POST['inputValue'])) {
$receivedValue = htmlspecialchars($_POST['inputValue']); // Sanitize input
}
?>
Hi Sirs;
$receivedValue = "";
if (isset($_POST['inputValue'])) {
$receivedValue = htmlspecialchars($_POST['inputValue']); // Sanitize input
}
?>
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Raghunath BhukanPosted Jan 16, 2026, 3:03 AM
Problems in the current code:
Both pages submit to the same PHP file, which makes it unclear which page is handling the request.
The input field on the second page does not have a
nameattribute, so its value cannot be submitted.The first page is missing a complete HTML structure.
Separating responsibilities between pages improves clarity and maintainability.
Correct and simple approach:
Use two separate PHP files:
page1.phpto collect the inputpage2.phpto receive and display the valuePage 1 (
page1.php)This page sends the value to Page 2.
Page 2 (
page2.php)This page receives the value and displays it in another input field.
IsraelPosted Jan 20, 2026, 10:18 PM
$receivedValue = "";
if (isset($_POST['inputValue'])) {
$receivedValue = htmlspecialchars($_POST['inputValue'], ENT_QUOTES, 'UTF-8');
}
?>
@Raghunath Bhukan
I was trying to add a third and fourth page. But I cannot see input' s value appearing on it. I can see it ONLY on the second page. How can I resolv it please.
IsraelPosted Jan 16, 2026, 11:28 AM
@Raghunath Bhukan
Thank you Raghunath to help me to resolv it.