Results 1 to 2 of 2

Thread: display form input in another page

  1. #1
    Join Date
    Oct 2007
    Posts
    103

    display form input in another page

    Hi,
    I am trying to test a very simple form to see if i can display the input in another page. But it doesnt display anything in the destination page.

    Here is the html code in the first file:
    <form method="post" action"displayresults.php">
    first input:<br/>
    <input type="text" name="myinput1" />

    and in displayresults.php I have the following code
    $myinput1=$_POST['myinput1'];
    echo $myinput1;
    And it is not displaying any info that I entered.
    I have two questions:
    1-Why this does not work, what's wrong?
    2-When I submit values in the first file, where and when do those values get stored? Does it get sent right away to the destination page? I mean lets say I submit info and then turn off my computer and then next day when I open displayresults.php is it supposed to show the result or do you need to do it in the same session, or how does this work?

  2. #2
    Join Date
    Apr 2008
    Location
    Chicago area, Soon Germany
    Posts
    181
    Code:
    <form action="displayresults.php" method="post">
    You are missing the = sign in the action attribute. Those values are stored only as a one time accessible variable. The variable is carried only so far as the next page. If you want to save it over longer time, you have to save it in a cookie or in a database.

Similar Threads

  1. Dumb Newb Question: Why doesn't page size display work in DW CS3?
    By Stearmandriver in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 21 Feb 2008, 04:26 AM
  2. how do I validate fields for this multi page form
    By dude9er in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 15 Jan 2006, 01:18 AM
  3. create page from a form
    By shdwmnk in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 17 Dec 2005, 05:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •