RE: [PHP-GENERAL] Greetings and Help With Forms

From: Date: Fri, 09 Jun 2000 19:34:04 +0000
Subject: RE: [PHP-GENERAL] Greetings and Help With Forms
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-1415@lists.php.net to get a copy of this message
Use the header() function like this: header("Location: http://somewhere.com/somepage.php"); Note: you must use this before any output is sent to the browser. Good Luck, Jason > -----Original Message----- > From: Phillip S. Baker [mailto:phillip@wordsandimages.com] > Sent: Friday, June 09, 2000 1:27 PM > To: php-general@lists.php.net > Subject: [PHP-GENERAL] 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 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > _______________________________________________________ Site Design, Hosting, and E-Commerce at www.webpipe.net

« previous php.general (#1415) next »