For Programmers: Free Programming Magazines  


Home > Archive > PHP Programming > March 2005 > q. Getting Multipart Form to move to the next form









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author q. Getting Multipart Form to move to the next form
Willoughby Bridge

2005-03-30, 3:56 pm

Hi -

Having trouble getting a multipart series of forms to move to the next form.
The problem line is:
<form method="post" enctype="multipart/form-data" action="Data_Form1.php">

If the "action" parameter is set to the current form (Data_Form1.php) then
the data posts to the table correctly, but it does not move to the next form
If the "action" parameter is set to the next form in the series then by
clicking "submit" it moves to the next form, but the data does not post to
the table.

I appreciate any suggestions - Maybe need a separate command is needed to
make it post

TIA

David

Whole sheet is listed below and located at
http://www.teachercards.org/Data_Form.php


<html>



<body>



<?php



if ($submit) {

$conn = mysql_connect("mysql", "TeacherCards", "164333") or die("Cannot
connect to server");

mysql_select_db("Teachercards",$conn) or die("Cannot find database");

$sql = "INSERT INTO Teachers
(School,Email,Name,Subject,College,Motto
,Story,Food,Color,Hobby,Place,Animal
,Movie,Song,Book,Comment)
VALUES('$School','$Email','$Name','$Subj
ect','$College','$Motto','$Story','$
Food','$Color','$Hobby','$Place','$Anima
l','$Movie','$Song','$Book','$Commen
t')";

$result = mysql_query($sql);



}





Else



{

// display form





?>



<form method="post" enctype="multipart/form-data" action="Data_Form1.php">



<BODY LINK="#0000ff" VLINK="#800080" BACKGROUND="./wall.jpg">

<br>

    <Font Size =5/><B/>Enter information to build your
own Teacher Card: <br></Font Size =5>



<br><br>



    School
Name:            
;    <input type="Text" name="School", size=30,
maxlength=20>

<br><br>



    Email
Address:           &n
bsp;  <input type="Text" name="Email", size=30, maxlength=20>

<br><br>





    Name  (e.g. Mr. Lue):   <input
type="Text" name="Name", size=30, maxlength=28>



<br><br>



    Subject (main subject):  <input
type="Text" name="Subject", size=30, maxlength=11>



<br><br>



    College
Attended:         <input
type="Text" name="College", size=30, maxlength=16>



<br><br>



    Motto:       &nbs
p;            &n
bsp;       <input type="Text"
name="Motto", size=30, maxlength=28>



<br><br>



    Favorite
Food:            
;   <input type="Text" name="Food", size=30, maxlength=16>



<br><br>



    Favorite
Color:           &nbs
p;  <input type="Text" name="Color", size=30, maxlength=25>

<br><br>



    Favorite
Hobby:           &nbs
p;<input type="Text" name="Hobby", size=30, maxlength=15>

<br><br>



    Favorite
Place:           &nbs
p;  <input type="Text" name="Place", size=30, maxlength=25>

<br><br>



    Favorite
Animal:           <in
put type="Text" name="Animal", size=30, maxlength=25>

<br><br>



    Favorite
Movie:           &nbs
p;<input type="Text" name="Movie", size=30, maxlength=25>

<br><br>





    Favorite
Song:            
;   <input type="Text" name="Song", size=30, maxlength=25>

<br><br>



    Favorite
Book:            
;  <input type="Text" name="Book", size=30, maxlength=25>

<br><br>



    Untold
Story:        
        <textarea name="Story",
cols=30, rows=3,wrap=virtual, maxlength=148></textarea>

<br><br>

    Comment/Suggestion:   <textarea
name="Comment", cols=30, rows=3,wrap=virtual,maxlength=148></textarea>

</B>

<br>

    e.g. Can Favorite Food be replaced with Favorite
Sport which is football



<br><br>





     <input type="submit" name="submit"
value="Upload Information">



</form>



<?php



}

// end if





?>



</body>



</html>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com