PHP JavaScript question

Posted on 2006-05-08
Last Modified: 2006-11-18
I have a sample php page which generates html like this:

<form name=abc method=post action="xyz.php">
<input type=text name='LName' value='lastname'>
<input type=text name='FName' value='firstname'>
<input type=text name='CDate' value='05/05/2006'>

<form name=def method=post action="pqr.php">
<!-- some html embedded here-->

<form name=rst method=post action="yyy.php">
<input type=submit name='Update Stuff'>
<input type=reset name='Clear stuff'>


I want to access the form variables "LName", "FName", "CDate" from "yyy.php" page when I click on the "Update" button. "LName", "FName" and "CDate" values can be changed before hitting the submit button.

How can I do this?

Remember the form seperation in the above html. There is no way I can change the form seperation as it includes complex UI changes which are not required.

Question by:niftyhawk
    LVL 5

    Accepted Solution


    in php u would access them like
    $_POST[LName] , $_POST[FName] etc
    LVL 5

    Expert Comment

    and use this

    <form name=rst method=post action="yyy.php">
    <input type=button name='Update Stuff' onclick=''>
    <input type=reset name='Clear stuff'>

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now