Hi Sirs;
Someone can I help to transfert once from button an input content from the first page to three forms having on input each. Could you have a look on what I am trying to do. Its works but cannot transfert to the others pages. Thanks.
Hi Sirs;
Someone can I help to transfert once from button an input content from the first page to three forms having on input each. Could you have a look on what I am trying to do. Its works but cannot transfert to the others pages. Thanks.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question.
Tuhin PaulPosted Apr 8, 2026, 11:02 AM
1. The Immediate Fix (Naming Mismatch)
In your Page 1, your input name is
name="user". In your Page 2, you are trying to fetch$_POST['uname'].PHP is looking for a key that doesn't exist. Change Page 2 to:
2. Transferring to "Three Forms" (The Strategy)
If you want the username to persist across Page 2, Page 3, and Page 4, a standard
POSTwon't work becausePOSTdata only lives for one "jump."The Solution: PHP Sessions Sessions allow you to store the username on the server so every page can "remember" who the user is without re-submitting the form.
Updated Page 1 (Login)
Keep your HTML as is, but ensure the
actionpoints to your processing page.Updated Page 2 (The Receiver)
You must start a session at the very top of the file to "save" the data.
Page 3 and Page 4
Because the name is now in the
$_SESSION, you don't need to pass it via forms anymore. Just call it whenever you need it:3. Key Observations & Improvements
HTML Cleanup: In Page 1, you have. You only need one per row. Using that many empty tags can break your layout in some browsers.
The
disabledAttribute: In Page 2, you have the input marked asdisabled. Note: Disabled inputs are not sent when a form is submitted. If you need to send that data to Page 3 via a form, usereadonlyinstead ofdisabled.Security: Always use
htmlspecialchars()when printing user input back to the screen (as shown in my Page 2 example) to prevent XSS attacks.JavaScript Validation: In your script, you use
id.length=="". While this works in JS due to type coercion, it is cleaner to useid === ""orid.length === 0.