newbie question about php and html forms
Posted: Sat Nov 08, 2003 2:40 pm
Here's the php code for the form info:
[mod_edit:
Code: Select all
<?php
// open the connection
$conn = mysql_connect("localhost", "mysql", "blahblah");
// pick the database
mysql_select_db("sellers",$conn);
// create the SQL statement
$sql = "INSERT INTO clients values ('', '$_POST[coname]', '$_POST[costreet]',
'$_POST[cocity]', '$_POST[costate]', '$_POST[cozip]')";
// execute the SQL statement
if (mysql_query($sql, $conn)) {
header("Location: http://localhost/insert_form2.html");
} else {
echo "something went wrong!";
}
?>Code: Select all
tag added][/size]
My question is this: is there a more elegant/better way to redirect the user to a clean form other than using
'header("Location: http://localhost/insert_form2.html");'
(of course, 'localhost' will be something else in the future)??
Thanks in advance!