Alright, my current set up is this.
Form > Confirm Page > Fields page
The variable location, is getting as far as the confrim page. I can echo it there, but not at the fields page. Here is the code for the form, confirm and fields:
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<title>Paint-Zone</title>
</head>
<body class="main" topmargin="0" leftmargin="0">
<div id="banner">
<? include("banner.php"); ?>
</div>
<div id="bodymenu">
<? include("menutable.php"); ?>
</div>
<div id="bodycontent">
<form action="fieldconfirm.php" method="post">
Enter the name of the field: <input type="text" name="name" /><br />
Enter the location of the field:
<select name="location"><br />
<option value="Birmingham">Birmingham</option>
<option value="Manchester">Manchester</option>
<option value="London">London</option>
<option value="North Yorkshire">North Yorkshire</option>
</select><br />
Enter the phone number of the field: <input type="text" name="number" /><br />
Enter the email address of the field: <input type="text" name="email" /><br />
<label>Type a short summary:<br />
<textarea name="summary" rows="10" cols="40">
</textarea></label>
<input type="submit" value="Go!"/>
</form>
</div>
</body>
</html>
This is the confirm page
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<title>Paint-Zone</title>
</head>
<body class="main" topmargin="0" leftmargin="0">
<div id="banner">
<? include("banner.php"); ?>
</div>
<div id="bodymenu">
<? include("menutable.php"); ?>
</div>
<div id="bodycontent">
<?php
$dbcnx = @mysql_connect('ahem', 'ahem', 'ahem');
if (!$dbcnx) {
echo 'Unable to connect to the ' .
'database server at this time.' ;
exit();
}
// Select the database
if (!@mysql_select_db('paintzone')) {
exit('Unable to locate the ' .
'database at this time.');
}
// Write to the fields
if (isset($_POST['summary'])) {
$name= addslashes(htmlentities($_POST['name']));
$location= addslashes(htmlentities($_POST['location']));
$number= addslashes(htmlentities($_POST['number']));
$email= addslashes(htmlentities($_POST['email']));
$summary= addslashes(htmlentities($_POST['summary']));
$sql = "INSERT INTO arena(name, location, number, email, summary) VALUES ('$name', '$location', '$number', '$email', '$summary')";
if (@mysql_query($sql)) {
echo 'The field has been added';
echo "$location";
} else {
echo '<p>Error adding submitted review: ' .
mysql_error() . '</p>';
}
}
// Query All entries
$result = @mysql_query('SELECT * FROM arena');
if (!$result) {
echo ('<p>Error performing query: ' .
mysql_error() . '</p>');
}
?>
</div>
</body>
</html>
And this is the output page, fields.php. Every other varibale passes just fine.
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<title>Paint-Zone</title>
</head>
<body class="main" topmargin="0" leftmargin="0">
<div id="banner">
<? include("banner.php"); ?>
</div>
<div id="bodymenu">
<? include("menutable.php"); ?>
</div>
<div id="bodycontent">
<?php
$dbcnx = @mysql_connect('stuff', 'stuff', 'stuff');
if (!$dbcnx) {
echo 'Unable to connect to the ' .
'database server at this time.' ;
exit();
}
// Select the database
if (!@mysql_select_db('paintzone')) {
exit('Unable to locate the ' .
'database at this time.');
}
// Query All entries
$result = @mysql_query('SELECT * FROM arena');
if (!$result) {
echo ('<p>Error performing query: ' .
mysql_error() . '</p>');
}
else
{
print $_POST['location'];
$number_of_records = mysql_num_rows($result);
$name = mysql_result($result,$number_of_records-1,"name");
$location = mysql_result($result,$number_of_records-1,"location");
$number = mysql_result($result,$number_of_records-1,"number");
$email = mysql_result($result,$number_of_records-1,"email");
$summary = mysql_result($result,$number_of_records-1,"summary");
echo '<table width="600" cellspacing="0" border="2"><tr><td><center>' .$name .'</center></td><td><center>' .location .'<br /></center></td></tr><tr><td colspan="2"><center> ' .$number .' <br /><br /></center></td></tr><tr><td colspan="2"><center>' .$email .'</center></td></tr><tr><td colspan="2"><center>' .$summary .'</center></td></tr></table><br /><br /><br />';
$name = mysql_result($result,$number_of_records-2,"name");
$location = mysql_result($result,$number_of_records-2,"location");
$number = mysql_result($result,$number_of_records-2,"number");
$email = mysql_result($result,$number_of_records-2,"email");
$summary = mysql_result($result,$number_of_records-2,"summary");
echo '<table width="600" cellspacing="0" border="2"><tr><td><center>' .$name .'</center></td><td><center>' .location .'<br /></center></td></tr><tr><td colspan="2"><center> ' .$number .' <br /><br /></center></td></tr><tr><td colspan="2"><center>' .$email .'</center></td></tr><tr><td colspan="2"><center>' .$summary .'</center></td></tr></table><br /><br /><br />';
$name = mysql_result($result,$number_of_records-3,"name");
$location = mysql_result($result,$number_of_records-3,"location");
$number = mysql_result($result,$number_of_records-3,"number");
$email = mysql_result($result,$number_of_records-3,"email");
$summary = mysql_result($result,$number_of_records-3,"summary");
echo '<table width="600" cellspacing="0" border="2"><tr><td><center>' .$name .'</center></td><td><center>' .location .'<br /></center></td></tr><tr><td colspan="2"><center> ' .$number .' <br /><br /></center></td></tr><tr><td colspan="2"><center>' .$email .'</center></td></tr><tr><td colspan="2"><center>' .$summary .'</center></td></tr></table><br /><br /><br />';
}
?>
</div>
</body>
</html>