Jump to content

move data from one form to another


gwolff2005

Recommended Posts

Hi guys,

 

I need your help!

I have a survey, which goes over three pages. How can I save the data from the first page, carry it over the second one, carry the second and first one over to the third one and then show the results on the fourth one AND save all the results in mysql. The most important thing is that this runs in sessions, so a user is already logged on and his results need to be saved under his name

The rows in mysql are calle "porientation", "passion", and "motivation".

Thanks so much in advance. I put the codes for the pages underneath first, second and third testpage.

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <table width="667" border="1">
    <tr>
      <td>question one </td>
      <td>passionorientation</td>
      <td><p>
        <label>
          <input type="radio" name="po0" value="0" />
          0</label>
        <br />
        <label>
          <input type="radio" name="po1" value="1" />
          1</label>
        <br />
        <label>
          <input type="radio" name="po2" value="2" />
          2</label>
        <br />
        <label>
          <input type="radio" name="po3" value="3" />
          3</label>
        <br />
        <label>
          <input type="radio" name="po4" value="4" />
          4</label>
        <br />
        <label>
          <input type="radio" name="po5" value="5" />
          5</label>
        <br />
      </p></td>
    </tr>
    <tr>
      <td> </td>
      <td>passion</td>
      <td><p>
        <label>
          <input type="radio" name="p0" value="0" />
          0</label>
        <br />
        <label>
          <input type="radio" name="p1" value="1" />
          1</label>
        <br />
        <label>
          <input type="radio" name="p2" value="2" />
          2</label>
        <br />
        <label>
          <input type="radio" name="p3" value="3" />
          3</label>
        <br />
        <label>
          <input type="radio" name="p4" value="4" />
          4</label>
        <br />
        <label>
          <input type="radio" name="p5" value="5" />
          5</label>
        <br />
      </p></td>
    </tr>
    <tr>
      <td width="191"> </td>
      <td width="73">motivation</td>
      <td><p>
        <label></label>
        <input type="radio" name="m0" value="0" />
        0<br />
        <label>
          <input type="radio" name="m1" value="1" />
          1</label>
        <br />
        <label>
          <input type="radio" name="m2" value="2" />
          2</label>
        <br />
        <label>
          <input type="radio" name="m3" value="3" />
          3</label>
        <br />
        <label>
          <input type="radio" name="m4" value="4" />
          4</label>
        <br />
        <label>
          <input type="radio" name="m5" value="5" />
          5</label>
        <br />
      </p></td>
    </tr>
  </table>
</form>
</body>
</html>

 

 

The second one:

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <table width="667" border="1">
    <tr>
      <td>question one </td>
      <td>passionorientation</td>
      <td><p>
        <label>
          <input type="radio" name="po0" value="0" />
          0</label>
        <br />
        <label>
          <input type="radio" name="po1" value="1" />
          1</label>
        <br />
        <label>
          <input type="radio" name="po2" value="2" />
          2</label>
        <br />
        <label>
          <input type="radio" name="po3" value="3" />
          3</label>
        <br />
        <label>
          <input type="radio" name="po4" value="4" />
          4</label>
        <br />
        <label>
          <input type="radio" name="po5" value="5" />
          5</label>
        <br />
      </p></td>
    </tr>
    <tr>
      <td>page2</td>
      <td>passion</td>
      <td><p>
        <label>
          <input type="radio" name="p0" value="0" />
          0</label>
        <br />
        <label>
          <input type="radio" name="p1" value="1" />
          1</label>
        <br />
        <label>
          <input type="radio" name="p2" value="2" />
          2</label>
        <br />
        <label>
          <input type="radio" name="p3" value="3" />
          3</label>
        <br />
        <label>
          <input type="radio" name="p4" value="4" />
          4</label>
        <br />
        <label>
          <input type="radio" name="p5" value="5" />
          5</label>
        <br />
      </p></td>
    </tr>
    <tr>
      <td width="191"> </td>
      <td width="73">motivation</td>
      <td><p>
        <label></label>
        <input type="radio" name="m0" value="0" />
        0<br />
        <label>
          <input type="radio" name="m1" value="1" />
          1</label>
        <br />
        <label>
          <input type="radio" name="m2" value="2" />
          2</label>
        <br />
        <label>
          <input type="radio" name="m3" value="3" />
          3</label>
        <br />
        <label>
          <input type="radio" name="m4" value="4" />
          4</label>
        <br />
        <label>
          <input type="radio" name="m5" value="5" />
          5</label>
        <br />
      </p></td>
    </tr>
  </table>
</form>
</body>
</html>

The third one one:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  <table width="667" border="1">
    <tr>
      <td>question one </td>
      <td>passionorientation</td>
      <td><p>
        <label>
          <input type="radio" name="po0" value="0" />
          0</label>
        <br />
        <label>
          <input type="radio" name="po1" value="1" />
          1</label>
        <br />
        <label>
          <input type="radio" name="po2" value="2" />
          2</label>
        <br />
        <label>
          <input type="radio" name="po3" value="3" />
          3</label>
        <br />
        <label>
          <input type="radio" name="po4" value="4" />
          4</label>
        <br />
        <label>
          <input type="radio" name="po5" value="5" />
          5</label>
        <br />
      </p></td>
    </tr>
    <tr>
      <td>page3</td>
      <td>passion</td>
      <td><p>
        <label>
          <input type="radio" name="p0" value="0" />
          0</label>
        <br />
        <label>
          <input type="radio" name="p1" value="1" />
          1</label>
        <br />
        <label>
          <input type="radio" name="p2" value="2" />
          2</label>
        <br />
        <label>
          <input type="radio" name="p3" value="3" />
          3</label>
        <br />
        <label>
          <input type="radio" name="p4" value="4" />
          4</label>
        <br />
        <label>
          <input type="radio" name="p5" value="5" />
          5</label>
        <br />
      </p></td>
    </tr>
    <tr>
      <td width="191"> </td>
      <td width="73">motivation</td>
      <td><p>
        <label></label>
        <input type="radio" name="m0" value="0" />
        0<br />
        <label>
          <input type="radio" name="m1" value="1" />
          1</label>
        <br />
        <label>
          <input type="radio" name="m2" value="2" />
          2</label>
        <br />
        <label>
          <input type="radio" name="m3" value="3" />
          3</label>
        <br />
        <label>
          <input type="radio" name="m4" value="4" />
          4</label>
        <br />
        <label>
          <input type="radio" name="m5" value="5" />
          5</label>
        <br />
      </p></td>
    </tr>
  </table>
</form>
</body>
</html>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/153905-move-data-from-one-form-to-another/
Share on other sites

Ok but the challenge is the following. I have lets say ten questions per page. all aof the answers are radio buttons from the value between 0 and five so I ahve 3 questions regarding motivation which needed to be added, 3 questions regarding passionorientation and 4 questions regarding passion. I neednow first a routine which counts the passionresults, the passionorientationresults and the motivationresults apart from each other and stores them, transfers it to the next page, the same again and on the third page again... Then on the results page, the results of all three groups need to be counted together, separatly and need to be displayed....

HOW????  ???

Use a database.

readup on mysql or sqlite (sqlite is part of php5) mysql ya can find a lot more tutorials for.

 

It sounds like u dun have a clear idea of how it all works.

 

start with data, how will the data be organized/stored/manipulated.

than work on the interface

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.