RE: Greetings and Help With Forms

From: Date: Sun, 11 Jun 2000 05:46:38 +0000
Subject: RE: Greetings and Help With Forms
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-1554@lists.php.net to get a copy of this message
<FORM ACTION="http://www.wereto.com/file.htm" METHOD="post"> or <FORM ACTION="file.htm" METHOD="post"> if it is in same directory Ted Knudson http://www.automatedcabinets.com http://www.pulsarusa.com > -----Original Message----- > From: Phillip S. Baker [mailto:phillip@wordsandimages.com] > Sent: Friday, June 09, 2000 2:27 PM > To: php-general@lists.php.net > Subject: Greetings and Help With Forms > > > Greetings all, > > My Name is Phillip. > > I am new to programming and PHP. I just started late last week to > learn both of these web development tools. > > I am dropping a note as I am creating a form in PHP to handle data > and load it into a MySQL DB. The question I have is what parameters > do I use to pass the user to a specific page after they enter > information into form. > > The code I am basing this off of is from the webmonkey tutorial. > > > <?php > if ($submit) > { > //Process the form > $db = mysql_connect("localhost", "root"); > mysql_select_db("test",$db); > $sql = "insert into employees > (first,last,address,position) values > ('$first','$last','$address','$position')"; > $result = mysql_query($sql); > echo "Thank you! Information entered.\n"; > } > > else > { > //Display the form to fill out > ?> > > <FORM ACTION="<?php echo $PHP_SELF?>" METHOD="post"> > First Name: <INPUT TYPE="text" NAME="first" > SIZE="20"><BR> > Last Name: <INPUT TYPE="text" NAME="last" > SIZE="20"><BR> > Address: <INPUT TYPE="text" NAME="address" > SIZE="20"></TEXTAREA><BR> > Position: <INPUT TYPE="text" NAME="position" > SIZE="20"><BR> > <INPUT TYPE="submit" NAME="submit" VALUE="Enter > Information"> > </FORM> > <?php > //Close the if statment > } > ?> > > > So basically instead of the echo statement when someone submits the > form. I would like to take them to another URL. > > How would I specify that? > > Thanks > > Phillip > -- > > Phillip S. Baker > > phillip@wordsandimages.com > Words & Images, Inc. > 1535 Seabright Avenue, Suite 100, Santa Cruz, CA 95062 > Direct Line (831) 420-2641 / Fax (831) 458-0808 >

« previous php.general (#1554) next »