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.
Code
User:
Mot de passe:
function validation()
{
var id=document.f1.user.value;
var ps=document.f1.pass.value;
if(id.length=="" && ps.length=="") {
alert("blabla1");
return false;
}
else
{
if(id.length=="") {
alert("Le champ Utilisateur est vide");
return false;
}
if (ps.length=="") {
alert("blabla2");
return false;
}
}
}
Hi customer...!
" disabled>
Tuhin PaulRank #7 · 71.9K reputationPosted Apr 8, 2026, 7:02 AM EDT
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.Know the answer? Forums 01
Arun PottiAnswers in the forums20answers02
Tahir AnsariAnswers in the forums5answers03
Kamlesh KumarAnswers in the forums5answers04
Sam HobbsAnswers in the forums4answers05
Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.Join Full leaderboard → 2026
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
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.Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts