For starters im making a survey form for a website and ive run into a bit of trouble, if anyone could help and point me in the right direction it would be muchly appreciated :)

Im a bit of a php/mysql noob, I can kinda make cookies, I kinda know how to start sessions and i kinda can insert data into mysql.

What i have at the moment is 6 pages. index.php, survey1.php, survey2.php, survey3.php, survey4.php, survey5.php and survey6.php. The survey pages are all pages which contains forms that i have to take the data from and insert into my sql. Except survey1 which just says do you want to start the survey and then takes you to the first survey page(I thought maybe I should start the session/cookie here. The pages have next and back buttons on them to navigate through the survey. I am only allowed to use php.

[IMG]http://i30.tinypic.com/259kf1h.jpg[/IMG]

I'll post my assignment here so you can see what i have to do, could someone please help me out im really stuck. I've basically made all my forms, now I just need to make it all work. Heres what i need to do......

*	A student must access and complete section 1 before proceeding to any other section.  (For instance if a student types in the URL for section 2 they will automatically be redirected back to section 1 if they have not completed it)

*	A student must be able to navigate between each section once they have entered details for section 1.  

*	When a student navigates to a previous section, the data that they entered for that section will be displayed with the HTML form controls (e.g. for a input field of type text, it will be loaded with the value that was entered into it)

*	All input for each section must be validated before the student can continue to the next section.  If any data is not valid then the section must be redisplayed with HTML form controls loaded with previously entered data, along with appropriate error messages

*	This assessment must be developed using only PHP, HTML, and MYSQL and must run on your assigned webserver and database accounts.  No javascript, pop windows etc needed.

My next and back buttons dont work, im pretty much totally lost now, so anything would help me alot. Thanks guys

::EDIT:: Ive just been looking at some more stuff and i think ive got stuff going wrong so i thought I would post my code as well so you can see.......

survey1.php

<!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>Survey start page</title>
</head>

<BODY>
<body bgcolor="#CCCCCC">
<FORM name=questionare method="post" enctype="application/x-www-form-urlencoded"><!--                    Wintec Survey - Damion mitchell 07246415                     -->

  <div align="center"><img src="wintecBanner.jpg" alt="banner" width="987" height="113" /></div>
  <TABLE align=center bgColor=#ffffff border=1 cellPadding=0 cellSpacing=0  height=300 width="987" bordercolor="#969db8">
 <TBODY> 
 <TR vAlign=center> 

      <TD height=103 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=103 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=103 width="717"><p align="center">&nbsp;</P>
        <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Please take a moment to fill out our Wintec survey </b>&nbsp;&nbsp;      </font></P>
        <P align=left><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
          The information you supply  will be kept confidential and will 
          only be used to help improve your student experience at Wintec. </font></P>
      <P align=left><FONT face=Verdana size=2>There are five sections to fill out in total, simply hit the next button at the bottom of the page when you have finished a section. When you reach the end hit the submit button to finish the survey. At any time you wish to return to a previous page to change information press the back button in your browser.  </FONT></P>
      <P align=left><FONT face=Verdana size=2><strong>Please at no time use the forward or back buttons on your browser to navigate the survey. Use the next or back buttons at the bottom of the survey page to do that. You can go back and change information at any time. </strong></FONT></P>
      <P align=left>&nbsp;</P>
      <P align=left><font size="2" face="Verdana">Press start to begin.</font>...</P>
      <P align=left>&nbsp;</P></TD>
</TR>



<TR vAlign=center> 

      <TD height=43 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=43 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=43 width="717"> 

      <P>
	  <img src="spacer.jpg" />
         <input name=Next1 type=submit id="Next1" value="START SURVEY" />
      </P>      </TD>
</TR>
    </TBODY> 
  </TABLE>
</FORM>

</BODY>
</html>

survey2.php

<!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>Survey Page 1/5</title>
</head>

<BODY>
<body bgcolor="#CCCCCC">
<FORM name=questionare method="post" enctype="application/x-www-form-urlencoded"><!--                    Wintec Survey - Damion mitchell 07246415                     -->

  <div align="center"><img src="wintecBanner.jpg" alt="banner" width="987" height="113" /></div>
  <TABLE align=center bgColor=#ffffff border=1 cellPadding=0 cellSpacing=0  height=671 width="987" bordercolor="#969db8">
 <TBODY> 
 <TR vAlign=center> 

      <TD height=103 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=103 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=103 width="717">
	  <P align=center><?php
	  include("quotes.php");
	  ?>
	   
	     
      
		<P align=center><font face="Verdana" size="2"><strong><font size="4">Section 1 - Student Profile Information</font></strong> <br>
&nbsp;</font></P>      </TD>
</TR>

<TR vAlign=center> 

      <TD height=33 vAlign=top width="255" bgcolor="#969db8"> 
             <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><br><b>Age Range</b></FONT><br><br> </DIV>      </TD>

      <TD height=33 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=33 width="717">
             <FONT face="Verdana, Arial, Helvetica, sans-serif" size=3>&nbsp; 

                        <SELECT name=age  
        size=1>
                   	      
					          <OPTION>15 - 24</OPTION>
					          <OPTION selected>25 - 34</OPTION>
					          <OPTION>35 - 44</OPTION>
					          <OPTION>45 - 54</OPTION>
					          <OPTION>55 +</OPTION>
					          
					          <
	         </SELECT>
          </FONT>       </TD>
</TR>

<TR vAlign=center> 

      <TD height=24 vAlign=top width="255" bgcolor="#969db8"> 
              <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><br><b>Gender</b></FONT><br><br> </DIV>      </TD>

      <TD height=24 width="7" bgcolor="#969db8">&nbsp;      </TD>
      <TD bgColor=#d6d9e4 height=24 width="717"> 
            <INPUT name=gender  type=radio value=Female>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Female </FONT> &nbsp; 
            <input name=gender type=radio value=Male>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Male</FONT>       </TD>
</TR>

<TR vAlign=center> 

      <TD height=36 vAlign=top width="255" bgcolor="#969db8"> 
        <div align="right"><b><font face="Verdana, Arial, Helvetica, sans-serif"  size=2><br>Time Spent at Wintec</font></b><br><br></div>      </TD>

      <TD height=36 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=36 width="717">&nbsp; 
	
	        
        <select size="1" name="yearsSpent">
          <option>Not a student</option>
		  		  <option selected>0 to 6 months</option>
		          <option>6 months to a year</option>
		          <option>1 to 2 years</option>
		          <option>2 to 3 years</option>
		          <option>3 to 4 years</option>
		          <option>4 years +</option>
		          <
          </select>      </TD>
</TR>


<TR vAlign=center> 

      <TD height=91 vAlign=top width="255" bgcolor="#969db8"> 
            <div align="right">
            <font face="Verdana, Arial, Helvetica, sans-serif"  size=2>
               <br><b>What are you interested in at Wintec?               </b>           </font>
		   <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><b> <br>(tick all boxes that apply)</b><br><br>
           </div>      </TD>

      <TD height=91 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=91 width="717">
            <font face="Verdana, Arial, Helvetica, sans-serif" size=2>            </font> 
    
       <table border=0 cellpadding=0 cellspacing=3 width="100%" height="70">
       <tbody> 

       <tr valign=top> 
            <td width="47%" height="76"> 
              <font face="Verdana, Arial, Helvetica, sans-serif" size=2> 
              <input  name=interest1 type=checkbox value="1">
               Business and Administration   <br>
              <input     
            name=interest2 type=checkbox value="1">
               Communication     <br>
              <input  name=interest3 type=checkbox value="1">
                 Education    <br>
				 <input  name=interest4 type=checkbox value="1">
                 English Language    <br>
				 <input  name=interest5 type=checkbox value="1">
                 Health    <br>
              <input  name=interest6 type=checkbox value="1">&nbsp;Information Technology              </font>            </td>
            
             <td width="53%" height="76"> 
               <font face="Verdana, Arial, Helvetica, sans-serif" size=2> 
               
              <input name=interest7 type=checkbox value="1">
               Tourism/Hospitality <br>
               
              <input name=interest8 type=checkbox  value="1">
                    Media Arts              <br>
					<input name=interest9 type=checkbox  value="1">
                    Science              <br>
					<input name=interest10 type=checkbox  value="1">
                    Trades & Engineering              <br>
					<input name=interest11 type=checkbox  value="1">
                    Social Development              <br>
					<input name=interest12 type=checkbox  value="1">
                    Sport & Excecise Science              <br>
               
              <input name=interest13 type=checkbox  value="1">
                   Maori, Pasifika and Idigenous Studies                        <br>
               </font>              </td>
        </tr>
        </tbody> 
        </table>

            <font face="Verdana, Arial, Helvetica, sans-serif" size=2>            </font>        </TD>
</TR>


<TR vAlign=center> 

      <TD height=55 vAlign=top width="255" bgcolor="#969db8"> 
            <div align="right">
            <font face="Verdana, Arial, Helvetica, sans-serif"  size=2><br><b>In general are you happy with your experience so far at Wintec?</b>            </font><br><br> 
            </div>      </TD>

      <TD height=55 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=55 width="717"> &nbsp; 
        <input type="radio" name="rgFonts" value="Yes">
        <font face="Verdana, Arial, Helvetica, sans-serif" size=2>Yes        </font> 
        <input type="radio" name="rgFonts" value="No">
        <font face="Verdana, Arial, Helvetica, sans-serif" size=2>No        </font>     </TD>
</TR>

<TR vAlign=center> 

      <TD height=42 vAlign=top width="255" bgcolor="#969db8"> 
            <DIV align=right>
            <FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><br><b>How did you find out about Wintec</b>            </FONT><br><br>
            </DIV>      </TD>

      <TD height=42 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=42 width="717">&nbsp; 

          
        <select name=ddmFind size=1>
          <option selected>Newspaper/Magazine</option>
          <option>Acquaintance/Collegue</option>
          <option>Friend</option>
          <option>School/College</option>
          <option>Search Engine</option>
		  <option>Other</option>
        </select>       </TD>
</TR>

<TR vAlign=center> 

      <TD height=55 vAlign=top width="255" bgcolor="#969db8"> 
            <div align="right">
            <font face="Verdana, Arial, Helvetica, sans-serif"  size=2><br><b>Are you an international student?</b>            </font><br><br> 
            </div>      </TD>

      <TD height=55 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=55 width="717"> &nbsp; 
        <input type="radio" name="intStudent" value="Yes">
        <font face="Verdana, Arial, Helvetica, sans-serif" size=2>Yes        </font> 
        <input type="radio" name="intStudent" value="No">
        <font face="Verdana, Arial, Helvetica, sans-serif" size=2>No        </font>     </TD>
</TR>


<TR vAlign=center> 

      <TD height=91 vAlign=top width="255" bgcolor="#969db8"> 
            <div align="right">
            <font face="Verdana, Arial, Helvetica, sans-serif"  size=2>
               <br><b>Please choose your ethnicity               </b>           </font>
		   <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><b> <br>(tick all boxes that apply)</b><br><br>
           </div>      </TD>

      <TD height=91 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=91 width="717">
            <font face="Verdana, Arial, Helvetica, sans-serif" size=2>            </font> 
    
       <table border=0 cellpadding=0 cellspacing=3 width="100%" height="70">
       <tbody> 

       <tr valign=top> 
            <td width="47%" height="76"> 
              <font face="Verdana, Arial, Helvetica, sans-serif" size=2> 
              <input  name=interest1 type=checkbox value="1">
               NZ Euorpean   <br>
              <input     
            name=interest2 type=checkbox value="1">
               Maori     <br>
              <input  name=interest3 type=checkbox value="1">
                 Samoan    <br>
				 <input  name=interest4 type=checkbox value="1">
                 Cook Island Maori    <br>
				 <input  name=interest5 type=checkbox value="1">
                 Tongan    <br>
              <input  name=interest6 type=checkbox value="1">&nbsp;Niuean              </font>            </td>
            
             <td width="53%" height="76"> 
               <font face="Verdana, Arial, Helvetica, sans-serif" size=2> 
               
              <input name=interest7 type=checkbox value="1">
               Chinese <br>
               
              <input name=interest8 type=checkbox  value="1">
                    Japanese              <br>
					<input name=interest9 type=checkbox  value="1">
                    Indian              <br>
					<input name=interest10 type=checkbox  value="1">
                    American              <br>
					<input name=interest11 type=checkbox  value="1">
                    Dutch              <br>
					<input name=interest12 type=checkbox  value="1">
                    Tokelauan              <br>
               
              <input name=interest13 type=checkbox  value="1">
                   Other (please specify)                        <br>
               </font>              </td>
        </tr>
        </tbody> 
        </table>

            <font face="Verdana, Arial, Helvetica, sans-serif" size=2>            </font>        </TD>
</TR>


<TR vAlign=center> 

      <TD height=43 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=43 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=43 width="717"> 

      <P>
	  <img src="spacer.jpg" />
         <input name=Next1 type=submit id="Next1" value="Next" />
      </P>      </TD>
</TR>
    </TBODY> 
  </TABLE>
</FORM>

</BODY>
</html>

survey3.php

<!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>Survey Page 2/5</title>
</head>

<BODY>
<body bgcolor="#CCCCCC">
<FORM name=questionare method="post" enctype="application/x-www-form-urlencoded"><!--                    Wintec Survey - Damion mitchell 07246415                     -->

  <div align="center"><img src="wintecBanner.jpg" alt="banner" width="987" height="113" /></div>
  <TABLE align=center bgColor=#ffffff border=1 cellPadding=0 cellSpacing=0  height=671 width="987" bordercolor="#969db8">
 <TBODY> 
 <TR vAlign=center> 

      <TD height=103 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=103 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=103 width="717">
	  <P align=center><?php
	  include("quotes.php");
	  ?>  
      
		<P align=center><font face="Verdana" size="2"><strong><font size="4">Section 2 - Student Services</font></strong> <br>
&nbsp;</font></P>      </TD>
</TR>

<TR vAlign=center> 

      <TD height=24 vAlign=top width="255" bgcolor="#969db8"> 
              <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><b>Have you used the Wintec website before?</b></FONT><br><br> </DIV>
      </TD>

      <TD height=24 width="7" bgcolor="#969db8">&nbsp;      </TD>
      <TD bgColor=#d6d9e4 height=24 width="717"> 
            <INPUT name=usedSite  type=radio value=Yes>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Yes </FONT> &nbsp; 
            <input name=usedSite type=radio value=No>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>No</FONT>
       </TD>
</TR>

<TR vAlign=center> 

      <TD height=33 vAlign=top width="255" bgcolor="#969db8"> 
             <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><b>If you used it, how helpful did you find it?</b></FONT><br><br> </DIV>
      </TD>

      <TD height=33 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=33 width="717">
             <FONT face="Verdana, Arial, Helvetica, sans-serif" size=3>&nbsp; 

                        <SELECT name=helpSite  
        size=1>
                   	      
					          <OPTION>Very helpful</OPTION>
					          <OPTION selected>Helpful</OPTION>					          
					          <OPTION>Not at all helpful</OPTION>
					          <OPTION>Not Applicable</OPTION>
					          
					          <
					          
	         </SELECT>
          </FONT>
       </TD>
</TR>

<TR vAlign=center> 

      <TD height=33 vAlign=top width="255" bgcolor="#969db8"> 
             <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><b>If you used it, how easy was it to find the information you were looking for?</b></FONT><br><br> </DIV>
      </TD>

      <TD height=33 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=33 width="717">
             <FONT face="Verdana, Arial, Helvetica, sans-serif" size=3>&nbsp; 

                        <SELECT name=easyInfo  
        size=1>
                   	      
					          <OPTION>Very easy</OPTION>
					          <OPTION selected>Easy enough</OPTION>					          
					          <OPTION>Hard to find</OPTION>
					          <OPTION>Not Applicable</OPTION>
					          
					          <
					          
	         </SELECT>
          </FONT>
       </TD>
</TR>

<TR vAlign=center> 

      <TD height=33 vAlign=top width="255" bgcolor="#969db8"> 
             <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><b>If you used it, how satisfied were you with you you overall website experience?</b><br>(1 extremely satisfied, 10 extremely dissatisfied</FONT><br><br> </DIV>
      </TD>

      <TD height=33 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=33 width="717">
             <FONT face="Verdana, Arial, Helvetica, sans-serif" size=3>&nbsp; 

                        <SELECT name=rateSite  
        size=1>
                   	      
					          <OPTION>1</OPTION>
							  <OPTION>2</OPTION>
							  <OPTION>3</OPTION>
							  <OPTION>4</OPTION>
							  <OPTION selected>5</OPTION>
							  <OPTION>6</OPTION>
							  <OPTION>7</OPTION>
					          <OPTION>8</OPTION>					          
					          <OPTION>9</OPTION>
							  <OPTION>10</OPTION>
					          <OPTION>Not Applicable</OPTION>
					          
					          <
					          
	         </SELECT>
          </FONT>
       </TD>
</TR>

<TR vAlign=center> 

       <TD height=106 vAlign=top width="255" bgcolor="#969db8"> 
             <div align="right">
             <font face="Verdana, Arial, Helvetica, sans-serif" size=2><b><br><br>Please tell us if you have any suggestions on how we could improve the website</b>
             </font>
             </div>
      </TD>

      <TD height=106 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=106 width="717"><TEXTAREA name=suggestSite rows=5 cols=71>        </TEXTAREA>
      </TD>

</TR>

<TR vAlign=center> 

      <TD height=24 vAlign=top width="255" bgcolor="#969db8"> 
              <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><b>Have you used any of the Wintec computer labs before?</b></FONT><br><br> </DIV>
      </TD>

      <TD height=24 width="7" bgcolor="#969db8">&nbsp;      </TD>
      <TD bgColor=#d6d9e4 height=24 width="717"> 
            <INPUT name=usedLabs  type=radio value=Yes>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Yes </FONT> &nbsp; 
            <input name=usedLabs type=radio value=No>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>No</FONT>
       </TD>
</TR>

<TR vAlign=center> 

      <TD height=24 vAlign=top width="255" bgcolor="#969db8"> 
              <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><b>If you used them, how would you rate the quality of the equipment in the labs?</b></FONT><br><br> </DIV>
      </TD>

      <TD height=36 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=36 width="717">&nbsp; 
	
	        
        <select size="1" name="qualLabs">
          <option>Excellent quality</option>
		  		  <option selected>Good quality</option>
		          <option>Not so good quality</option>
		          <option>Bad Quality</option>		          
		          <option>Not applicable</option>
		          <
          </select>

      </TD>

</TR>

<TR vAlign=center> 

      <TD height=33 vAlign=top width="255" bgcolor="#969db8"> 
             <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><b>If you used them, how satisfied were you overall with the computer labs?</b><br>(1 extremely satisfied, 10 extremely dissatisfied</FONT><br><br> </DIV>
      </TD>

      <TD height=33 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=33 width="717">
             <FONT face="Verdana, Arial, Helvetica, sans-serif" size=3>&nbsp; 

                        <SELECT name=rateLabs  
        size=1>
                   	      
					          <OPTION>1</OPTION>
							  <OPTION>2</OPTION>
							  <OPTION>3</OPTION>
							  <OPTION>4</OPTION>
							  <OPTION selected>5</OPTION>
							  <OPTION>6</OPTION>
							  <OPTION>7</OPTION>
					          <OPTION>8</OPTION>					          
					          <OPTION>9</OPTION>
							  <OPTION>10</OPTION>
					          <OPTION>Not Applicable</OPTION>
					          
					          <
					          
	         </SELECT>
          </FONT>
       </TD>
</TR>

<TR vAlign=center> 

       <TD height=106 vAlign=top width="255" bgcolor="#969db8"> 
             <div align="right">
             <font face="Verdana, Arial, Helvetica, sans-serif" size=2><b><br><br>Please tell us if you have any suggestions on how we could improve the computer labs for students</b>
             </font>
             </div>
      </TD>

      <TD height=106 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=106 width="717"><TEXTAREA name=suggestLabs rows=5 cols=71>        </TEXTAREA>
      </TD>

</TR>

<TR vAlign=center> 

      <TD height=43 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=43 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=43 width="717"> 

      <P>
	  <img src="spacer.jpg" />
	  <input name=Back type=submit id="Back" value="Back" />
         <input name=Next2 type=submit id="Next2" value="Next" />
      </P>      </TD>
</TR>

    </TBODY> 
  </TABLE>
</FORM>

</BODY>
</html>

survey4.php

<!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>Survey Page 3/5</title>
</head>

<BODY>
<body bgcolor="#CCCCCC">
<FORM name=questionare method="post" enctype="application/x-www-form-urlencoded"><!--                    Wintec Survey - Damion mitchell 07246415                     -->

  <div align="center"><img src="wintecBanner.jpg" alt="banner" width="987" height="113" /></div>
  <TABLE align=center bgColor=#ffffff border=1 cellPadding=0 cellSpacing=0  height=671 width="987" bordercolor="#969db8">
 <TBODY> 
 <TR vAlign=center> 

      <TD height=103 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=103 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=103 width="717">
	  <P align=center><?php
	  include("quotes.php");
	  ?>  
      
		<P align=center><font face="Verdana" size="2"><strong><font size="4">Section 3 - Cafetaria</font></strong> <br>
&nbsp;</font></P>      </TD>
</TR>

<TR vAlign=center> 

      <TD height=33 vAlign=top width="255" bgcolor="#969db8"> 
             <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><b>How often do you use the Wintec cafetaria?</b></FONT><br><br> </DIV>
      </TD>

      <TD height=33 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=33 width="717">
             <FONT face="Verdana, Arial, Helvetica, sans-serif" size=3>&nbsp; 

                        <SELECT name=cafeUse  
        size=1>
                   	      	  <OPTION>Never</OPTION>
							  <OPTION>Once a month</OPTION>
					          <OPTION>Once a fortnight</OPTION>
					          <OPTION selected>Once a week</OPTION>							  
					          <OPTION>Two to three times a week</OPTION>
					          <OPTION>Every day</OPTION>
					          <OPTION>Multiple times every day</OPTION>
					          
					          <
					          
	         </SELECT>
          </FONT>
       </TD>
</TR>

<TR vAlign=center> 

      <TD height=91 vAlign=top width="255" bgcolor="#969db8"> 
            <div align="right">
            <font face="Verdana, Arial, Helvetica, sans-serif"  size=2>
               <b>If any, please choose which items you have purchased in the last six months.
               </b>
           </font>
		   <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><b> (tick all boxes that apply)</b><br><br>
           </div>
      </TD>

      <TD height=91 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=91 width="717">
            <font face="Verdana, Arial, Helvetica, sans-serif" size=2>            </font> 
    
       <table border=0 cellpadding=0 cellspacing=3 width="100%" height="70">
       <tbody> 

       <tr valign=top> 
            <td width="47%" height="76"> 
              <font face="Verdana, Arial, Helvetica, sans-serif" size=2> 
              <input  name=cafeChoose type=checkbox value="1">
               Pasta/Meat/Vege selection   <br>
              <input     
            name=interest2 type=checkbox value="1">
               Pizza     <br>
              <input  name=interest3 type=checkbox value="1">
                 Pies    <br>
				 <input  name=interest4 type=checkbox value="1">
                 Sandwiches/Wraps    <br>
				 <input  name=interest5 type=checkbox value="1">
                 Cakes/Chocolate    <br>
              <input  name=interest6 type=checkbox value="1">&nbsp;Information Technology
              </font> 
            </td>
            
             <td width="53%" height="76"> 
               <font face="Verdana, Arial, Helvetica, sans-serif" size=2> 
               
              <input name=interest7 type=checkbox value="1">
               Snack bars <br>
               
              <input name=interest8 type=checkbox  value="1">
                    Soup              <br>
					<input name=interest9 type=checkbox  value="1">
                    Coffee              <br>
					<input name=interest10 type=checkbox  value="1">
                    Water              <br>
					<input name=interest11 type=checkbox  value="1">
                    Fruit Juice/Energy drinks              <br>
					<input name=interest12 type=checkbox  value="1">
                    Carbonated drinks(coke etc)              <br>             
              
               </font>
              </td>
        </tr>
        </tbody> 
        </table>

            <font face="Verdana, Arial, Helvetica, sans-serif" size=2> 
            </font>
        </TD>
</TR>


<TR vAlign=center> 

      <TD height=42 vAlign=top width="255" bgcolor="#969db8"> 
            <DIV align=right>
            <FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><b>If you used it, how do you rate the quality of the food being served?</b>
            </FONT><br><br>
            </DIV>
      </TD>

      <TD height=42 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=42 width="717">&nbsp; 

          
        <select name=cafeQual size=1>          
          <option>Overall delicious</option>
          <option selected>Good</option>
		  <option>Not so good</option>
          <option>Disgraceful</option>
		  <option>Not applicable</option>          
        </select>
       </TD>

</TR>

<TR vAlign=center> 

      <TD height=42 vAlign=top width="255" bgcolor="#969db8"> 
            <DIV align=right>
            <FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><b>If you used it, what do you think of the cafetaria prices?</b>
            </FONT><br><br>
            </DIV>
      </TD>

      <TD height=42 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=42 width="717">&nbsp; 

          
        <select name=cafePrice size=1>          
          <option>Excellent value</option>
          <option selected>Good value</option>
		  <option>A little over priced</option>
          <option>Disgustingly overpriced</option>
		  <option>Not applicable</option>          
        </select>
       </TD>

</TR>

<TR vAlign=center> 

      <TD height=42 vAlign=top width="255" bgcolor="#969db8"> 
            <DIV align=right>
            <FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><b>If you used it, what do you think of the cafetaria overall?</b>
            </FONT><br><br>
            </DIV>
      </TD>

      <TD height=42 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=42 width="717">&nbsp; 

          
        <select name=cafeOverall size=1>          
          <option>Excellent </option>
          <option>Good </option>
		  <option selected>Not so good</option>
          <option>Appalling</option>
		  <option>Not applicable</option>          
        </select>
       </TD>

</TR>

<TR vAlign=center> 

       <TD height=106 vAlign=top width="255" bgcolor="#969db8"> 
             <div align="right">
             <font face="Verdana, Arial, Helvetica, sans-serif" size=2><b><br><br>Please tell us if you have any suggestions on how we could improve the cafetaria</b>
             </font>
             </div>
      </TD>

      <TD height=106 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=106 width="717"><TEXTAREA name=cafeComments rows=3 cols=71>        </TEXTAREA>
      </TD>

</TR>

<TR vAlign=center> 

      <TD height=43 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=43 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=43 width="717"> 

      <P>
	  <img src="spacer.jpg" />
	  <input name=Back2 type=submit id="Back2" value="Back" />
         <input name=Next3 type=submit id="Next3" value="Next" />
      </P>      </TD>
</TR>


    </TBODY> 
  </TABLE>
</FORM>

</BODY>
</html>

survey5.php

<!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>Survey Page 4/5</title>
</head>

<BODY>
<body bgcolor="#CCCCCC">
<FORM name=questionare method="post" enctype="application/x-www-form-urlencoded"><!--                    Wintec Survey - Damion mitchell 07246415                     -->

  <div align="center"><img src="wintecBanner.jpg" alt="banner" width="987" height="113" /></div>
  <TABLE align=center bgColor=#ffffff border=1 cellPadding=0 cellSpacing=0  height=671 width="987" bordercolor="#969db8">
 <TBODY> 
 <TR vAlign=center> 

      <TD height=103 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=103 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=103 width="717">
	  <P align=center><?php
	  include("quotes.php");
	  ?>  
      
		<P align=center><font face="Verdana" size="2"><strong><font size="4">Section 4 - Wintec Campus Design</font></strong> <br>
&nbsp;</font></P>      </TD>
</TR>

<TR vAlign=center> 

      <TD height=24 vAlign=top width="255" bgcolor="#969db8"> 
              <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><b>Do you use Wintec carparking?</b></FONT><br><br> </DIV>      </TD>

      <TD height=24 width="7" bgcolor="#969db8">&nbsp;      </TD>
      <TD bgColor=#d6d9e4 height=24 width="717"> 
            <INPUT name=useCarpark  type=radio value=Yes>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Yes </FONT> &nbsp; 
            <input name=useCarpark type=radio value=No>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>No</FONT>       </TD>
</TR>

<TR vAlign=center> 

      <TD height=33 vAlign=top width="255" bgcolor="#969db8"> 
             <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><br><b>If you do, how often do you use it?</b></FONT><br><br> </DIV>
      </TD>

      <TD height=33 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=33 width="717">
             <FONT face="Verdana, Arial, Helvetica, sans-serif" size=3>&nbsp; 

                        <SELECT name=carparkUse  
        size=1>
                   	      	  <OPTION>Never</OPTION>
							  <OPTION>Once a month</OPTION>
					          <OPTION>Once a fortnight</OPTION>
					          <OPTION selected>Once a week</OPTION>							  
					          <OPTION>Two to three times a week</OPTION>
					          <OPTION>Every day (Mon to Fri)</OPTION>
					          <OPTION>Multiple times every day</OPTION>
					          <OPTION>Not applicable</OPTION>
					          <
					          
	         </SELECT>
          </FONT>
       </TD>
</TR>

<TR vAlign=center> 

      <TD height=24 vAlign=top width="255" bgcolor="#969db8"> 
              <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><br><b>If you do, what time do you normally use it?</b></FONT><br><br> </DIV>      </TD>

      <TD height=24 width="7" bgcolor="#969db8">&nbsp;      </TD>
      <TD bgColor=#d6d9e4 height=24 width="717"> 
            <INPUT name=carparkTime  type=radio value=8am or before>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>8am or before </FONT> <br> 
			<INPUT name=carparkTime  type=radio value=8am - 10am>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>8am - 10am </FONT> <br> 
			<INPUT name=carparkTime  type=radio value=10am - 12pm>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>10am - 12pm </FONT> <br> 
			<INPUT name=carparkTime  type=radio value=12pm - 2pm>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>12pm - 2pm </FONT> <br> 
			<INPUT name=carparkTime  type=radio value=2pm - 4pm>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>2pm - 4pm </FONT> <br>
			<INPUT name=carparkTime  type=radio value=4pm+>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>4pm+ </FONT> <br>  
            <input name=carparkTime type=radio value=Not applicable>
            <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Not applicable</FONT>       </TD>
</TR>

<TR vAlign=center> 

      <TD height=33 vAlign=top width="255" bgcolor="#969db8"> 
             <DIV align=right><FONT face="Verdana, Arial, Helvetica, sans-serif"  size=2><br><b>If you use it, how easy is it for you to find a park?</b></FONT><br><br> </DIV>
      </TD>

      <TD height=33 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=33 width="717">
             <FONT face="Verdana, Arial, Helvetica, sans-serif" size=3>&nbsp; 

                        <SELECT name=carparkFrequncy  
        size=1>
                   	      	  <OPTION>Very easy</OPTION>
							  <OPTION selected>Easy</OPTION>
					          <OPTION>Not so easy</OPTION>
					          <OPTION>Hard</OPTION>							  
					          <OPTION>Practiacally impossible</OPTION>
					          <OPTION>Not applicable</OPTION>
					          
					          
					          <
					          
	         </SELECT>
          </FONT>
       </TD>
</TR>



<TR vAlign=center> 

       <TD height=106 vAlign=top width="255" bgcolor="#969db8"> 
             <div align="right">
             <font face="Verdana, Arial, Helvetica, sans-serif" size=2><b><br><br>Please tell us if you have any suggestions on how we could improve the campus carpaking.</b>
             </font>
             </div>
      </TD>

      <TD height=106 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=106 width="717"><TEXTAREA name=carparkComments rows=3 cols=71>        </TEXTAREA>
      </TD>

</TR>

<TR vAlign=center> 

      <TD height=43 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=43 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=43 width="717"> 

      <P> <img src="spacer.jpg" />
          <input name=Back3 type=submit id="Back3" value="Back" />
         <input name=Next4 type=submit id="Next4" value="Next" />
      </P>

      </TD>

</TR>

    </TBODY> 
  </TABLE>
</FORM>

</BODY>
</html>

survey6.php

<!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>Survey Page 1/5</title>
</head>

<BODY>
<body bgcolor="#CCCCCC">
<FORM name=questionare method="post" enctype="application/x-www-form-urlencoded"><!--                    Wintec Survey - Damion mitchell 07246415                     -->

  <div align="center"><img src="wintecBanner.jpg" alt="banner" width="987" height="113" /></div>
  <TABLE align=center bgColor=#ffffff border=1 cellPadding=0 cellSpacing=0  height=300 width="987" bordercolor="#969db8">
 <TBODY> 
 <TR vAlign=center> 

      <TD height=103 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=103 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=103 width="717"><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2><br>
        </FONT>
        <p align="center">&nbsp;</P>
        <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>IMPORTANT - please follow these instructions to submit this survey.... </b>&nbsp;&nbsp;      </font></P>
        <P align=left><font face="Verdana, Arial, Helvetica, sans-serif" size="2">
          If you are happy with all your answers in the survey please push the submit button to submit your survey and finish. </font></P>
      <P align=left><FONT face=Verdana size=2>If you would like to check the information you have entered, please use the back and next buttons to navigate through your answers.  When you are happy with all your answers, please hit the submit button.  </FONT></P>
      <P align=left><FONT face=Verdana size=2><strong>Alternatively if you would like to reset the survey and start again, please hit the resest button </strong></FONT></P>
      <P align=left><font size="2" face="Verdana">Thankyou for you participation.</font>...</P>
      <P align=left>&nbsp;</P>
      <P align=left>&nbsp;</P>
      <P align=left>&nbsp;</P>
      <P align=left>&nbsp;</P></TD>
</TR>


<TR vAlign=center> 

      <TD height=43 vAlign=top width="255" bgcolor="#969db8">&nbsp;</TD>
      <TD height=43 width="7" bgcolor="#969db8">&nbsp;</TD>
      <TD bgColor=#d6d9e4 height=43 width="717"> 

      <P> <img src="spacer2.jpg" />
          <input name=Back4 type=submit id="Back4" value="Back" />         
		  <input name=B1 type=submit value=" Submit Survey ">
          <input type="reset" value="Reset Form" name="Reset Survey">
      </P>

      </TD>

</TR>

    </TBODY> 
  </TABLE>
</FORM>

</BODY>
</html>

for a situtation like this I like to use a session and a switch statement. i put all of my forms into seperate html files and include them based on the survey that needs to be displayed.

example (named survery.php):

<?php

session_start();

if (!isset($_SESSION['survey'])) {
  $_SESSION['survey'] = 1;
}
$survey = $_SESSION['survey'];
switch($survey) {
	case 1:
		if (isset($_POST['submit'])) { //name of the submit button
			//process survey 1 here
		}
		include 'survey1.html';
	break;
	case 2:
		if (isset($_POST['submit'])) {
			//do the same thing
		}
		include 'survey2.html';
	break;
	case 3:
		i think you get the picture
	break;
	//and so on...
}

?>

And you need an action attribute in you opening form tag. ex. action="survey3.php"

Thats awsum thankyou, my next and back buttons work now =) Its all about baby steps lol. I can code C# and java ok, its just the syntax and stuff for php that is getting me. I know what i want my stuff to do, its just making it do it is the problem.

kkeith29 thankyou for that snippet, im still wrestling with it though. Thanks to you I now know its sessions i want to use to pass the variables from form to form, but im a little unsure where I want to put the php session code and how I have different sessions for new users etc. Im thinking i want to increment the session id or something like that. Also im pretty sure i want to pass the seesion id from page to page, but im still wrestling with that one too.

that was an html problem, do you know html? i would learn that first before jumping into php.

if you use my method you will only need one php page and 6 html pages. that one page will handle everything the project needs to do.

also, read up on sessions. i think you misunderstood how they work. if you get a better grasp on them you'll understand my code a little better.

Yeah i understand, someone else just explained to me what your code was doing just as you posted your reply. Yup I know html ok, its just php thats the killer at the moment. This assignment is due in two days and im struggling big time.

I've just sat here for 8 hours and im only a little further than when I began. Weve only just learnt this in class two weeks ago and now were expected to do this, im going to give it my best effort, but its not looking good so far.

Thanks for trying to help me though, really appreciate it.

I think im just going to put php on every page, cause that is all i know. I've just put

<?php 
session_start();
?>

on top of every page and im going to go from there. Fingers crossed.

If anyone has any other suggestions on how to do anything it would be much appreciated

I would use kkeith29's example and then in the part where he has put "//process survey 1 here" and "//do the same thing" I would loop through all the $_POST variables creating a session variable out of each one(preferably with a function call).

You can loop through the $_POST variables and add them to your session array like so:

foreach($_POST as $key=>$value)
{
	if($key != 'Next' && $key != 'Back') //you don't want your submit buttons' values added
	{
		$_SESSION[$key] = $value;
	}
}

Then what you've got in the end of the survey is an array called $_SESSION that has the field names as keys and answers as values and you can loop through those just like mentioned above when adding them to your sql statement in the end while avoiding the $_SESSION variable which is used for navigation.

This article has been dead for over six months. Start a new discussion instead.