", " "); $this = strtr($this, "<", " "); $this = strtr($this, "|", " "); $$key = $this; } //////////////////////////////// // This will catch if someone is trying to submit a blank // or incomplete form. //////////////////////////////// if ($name && $email && $message ) { //////////////////////////////// // This is the meat of the query that updates the guests table //////////////////////////////// $query = "INSERT INTO guests "; $query .= "(guest_id, guest_name, "; $query .= "guest_email, guest_time, guest_message) "; $query .= "values(guest_id_seq.nextval,'$name','$email',SYSDATE,'$message')"; //////////////////////////////// // This is where we connect first time to the database //////////////////////////////// $c1 = ocilogon("scott","tiger","dbougf"); $stmt = ociparse($c1,$query); OCIexecute($stmt,OCI_DEFAULT); OCIFreeStatement($stmt); OCICommit; } else { //////////////////////////////// // If they didn't include all the required fields set a variable // and keep going. //////////////////////////////// $notall = 1; } } ?> Add a Message

Add A Message

Please answer all fields

Your Name:       
Your Email:      

Enter Message:



people have left me a message.


\n"; $query = "SELECT guest_name,guest_email,to_char(guest_time,'DD.MM.YYYY HH24:MI:SS'),guest_message FROM guests WHERE ROWNUM<21 ORDER BY guest_time DESC"; } $stmt = OCIparse($c1,$query); OCIexecute($stmt,OCI_DEFAULT); //////////////////////////////// // This will loop as long as there are records waiting to be processed. // Notice the plain HTML inside the while loop structure. PHP is flexable // enough to allow you to break into and out of the "code" at any point. //////////////////////////////// // ------------------------ while start while (OCIFetchInto($stmt, &$guest)) { ?>
Name: Email: Time: