Here's an example of code: I have multiple page form. When the submit of each page is clicked it calls a php script that then opens the dbase, checks if the user has already replied to the page (for those who use the back arrow of the browser), writes the data, and then calls the next page. Here's one script: <?php session_start(); $datein=date("YmdHis"); session_register("datein"); include("filewithpasswordanddatabaselocation.inc"); $IP=$REMOTE_ADDR; $query = "INSERT INTO habits (datein,readcurrent,weekday,saturday,sunday,globe,tosun,post,metro,other,oth erdesc,ipaddress,dow,speed,whenread) values ('$datein','$readcurrent','$weekday','$saturday','$sunday','$globe','$sun',' $post','$metro','$other','$otherpaper','$IP','$dow','$internet','$whenread') "; $result = mysql_query($query); if ($readcurrent == "yes") { header("Location: ../pages/sections.php"); } else { header("Location: ../pages/category1.php"); } ?> The connection file looks like this: <?php $host="localhost"; $user="username"; $password="passwordgoeshere"; $database="databasegoeshere"; $connection = mysql_connect($host,$user,$password) or die ("couldn't connect to server"); $db = mysql_select_db($database,$connection) or die ("Couldn't select database"); ?> One question that has arisen from all this is whether I should be using pconnect() rather than connect()? Thanks for the info so far. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php