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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Raghunath BhukanRank #744 · 3.1K reputationPosted Jan 15, 2026, 10:03 PM EST
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 1 Enter Value: Go to Page 2Page 2 (
page2.php)This page receives the value and displays it in another input field.
Page 2 Received Value: ">IsraelRank #1,223 · 1.5K reputationPosted Jan 16, 2026, 6:28 AM EST
@Raghunath Bhukan
Thank you Raghunath to help me to resolv it.
IsraelRank #1,223 · 1.5K reputationPosted Jan 20, 2026, 5:18 PM EST
$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.