I'm going to post the code that I am currently using and then explain what I'm trying to do. I hope I can explain it well enough.
<?php
if (!isset($_POST['submit'])) {
echo'<leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">
<center><form name="fairlistlist" method="POST" action="'.$_SERVER['PHP_SELF'].'">
<TABLE width="450" height="119" border=0 cellPadding=3 cellSpacing=2 bgcolor="#fff568">
<TBODY>
<TR>
<TD class=mainText width="100"><b>Event Name</b></TD>
<TD width="305" class=frmInput> <INPUT class=mainFormBox style="WIDTH: 320px" type="text" name=" fairname"></TD>
</TR>
<TR>
<TD class=mainText width="100"><B>Event Address</B></TD>
<TD class=frmInput> <INPUT name="fairadd" type="text" class=mainFormBox id="fairadd" style="WIDTH: 320px"></TD>
</TR>
<TR>
<TD class=mainText width="100"><b>Event City</b></TD>
<TD class=frmInput> <INPUT name="faircity" type="text" class=mainFormBox id="faircity" style="WIDTH: 320px"></TD>
</TR>
<TR>
<TD class=mainText width="100"><b>Event County</b></TD>
<TD class=frmInput> <INPUT name="faircty" type="text" class=mainFormBox id="faircty" style="WIDTH: 320px"></TD>
</TR>
<TR>
<TD class=mainText width="100"><b>Event State</b></TD>
<TD class=frmInput> <INPUT name="fairstate" type="text" class=mainFormBox id="fairstate" style="WIDTH: 320px"></TD>
</TR>
<TR>
<TD class=mainText width="100"><b>Event Country</b></TD>
<TD class=frmInput> <INPUT name="fairctry" type="text" class=mainFormBox id="fairctry" style="WIDTH: 320px"></TD>
</TR>
<TR>
<TD class=mainText width="100"><b>Event Opening Date</b></TD>
<TD class=frmInput> <INPUT name="fairopen" type="text" class=mainFormBox id="fairopen" style="WIDTH: 320px"></TD>
</TR>
<TR>
<TD class=mainText width="100"><b>Event Closing Date</b></TD>
<TD class=frmInput> <INPUT name="fairclose" type="text" class=mainFormBox id="fairlose" style="WIDTH: 320px"></TD>
</TR>
<TR>
<TD class=mainText width="100"><b>Event Contact Email</b></TD>
<TD class=frmInput> <INPUT name="fairmail" type="text" class=mainFormBox id="fairmail" style="WIDTH: 320px"></TD>
</TR>
<TR>
<TD class=mainText width="100"><b>Event Website</b></TD>
<TD class=frmInput> <INPUT name="fairweb" type="text" class=mainFormBox id="fairweb" style="WIDTH: 320px"></TD>
</TR>
<TR>
<TD class=frmDescription width="56"> </TD>
<TD class=frmInput> <div align="right">
<input type="submit" name="submit" value="Add my Event" />
</div></TD>
</TR>
</TBODY>
</TABLE>
</form></center>
</body>';
//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());
header( 'Location: event_added.php' ) ;
}
?>
Especially look at the code part here
$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());
header( 'Location: event_added.php' ) ;
}
?>
this is where I am having problems it was reading
echo your record has been successfully added to the database
What I want is for it to open up a new page with my menu and my css and all that good crap to a page where it will read the following
Your information has been added to our database
We have added
Event name = "whatever the event's name was"
Event address = "address:"
so on and so on for all the fields in my form that was submitted to the database.
with just using the echo command it always opened to just a blank page no formatting and no css as well as no all important links
Can you please tell me what I'm doing wrong or where I can find a good guideline that Is easy to understand on how to do this?
Thanks in advance
Oh also I don't care if that page get's indexed by google or yahoo or not actually prefer it don't get indexed to be honest