how to put record added in new page

hello currently my code reads like this

[code]<?php
if (!isset($_POST[‘submit’])) {
echo’<leftmargin=“0” topmargin=“0” rightmargin=“0” bottommargin=“0”>
















































Event Name
Event Address
Event City
Event County
Event State
Event Country
Event Opening Date
Event Closing Date
Event Contact Email
Event Website
 




';
//note that I added a new field called submit and it’s hidden …
} else {

/*I added addslashes() so it escape any special char in the form ..
if you want to show your inserted record , you need to use stripslashes() to remove any slashes from the record ..
this is only to avoid some security problems in the query ..*/

$fairname=trim(addslashes($_POST['fairname']));
$fairadd=trim(addslashes($_POST['fairadd']));
$faircity=trim(addslashes($_POST['faircity']));
$faircty=trim(addslashes($_POST['faircty']));
$fairstate=trim(addslashes($_POST['fairstate']));
$fairctry=trim(addslashes($_POST['fairctry']));
$fairopen=trim(addslashes($_POST['fairopen']));
$fairclose=trim(addslashes($_POST['fairclose']));
$fairmail=trim(addslashes($_POST['fairmail']));
$fairweb=trim(addslashes($_POST['fairweb']));

include(“Connections/local.php”);
$link = mysql_connect($hostname_local,$username_local, $password_local)
or die(“Could not connect”);
mysql_select_db(‘fair123’)
or die(“Could not select database”);

$insert=mysql_query("INSERT INTO events (fairidnum, fairname, fairadd, faircity, faircty, fairstate, fairctry, fairopen, fairclose, fairmail, fairweb)
VALUES('NULL', '$fairname', '$fairadd', '$faircity', '$faircty','$fairstate', '$fairctry','$fairopen', '$fairclose', '$fairmail', '$fairweb')")or
die('couldn\'t Insert record into database :'.mysql_error());

echo'The Record was inserted succesfully into Database';
}
?>[/code]

If you notice the last few lines says echo'The Record was inserted succesfully into Database';

I would like that to display on a seperate page that has the rest of not sure if template is the right word for it but so it shows on a page similar to the rest of my pages meaning has my header and my links.

Would I just make a new page and remove the echo entry and use include statement? or what?

Sponsor our Newsletter | Privacy Policy | Terms of Service