I have a php page that does field validation. The form posts to itself in order to check which fields were not entered. Once the fields are properly entered, it is redirected to another page "abstract_page_2.php". Now once I am on the second page, I can no longer access the values that were previously filled in. What would be the alternative way of doing this since the header function doesn't seem to POST variables. I've just started using PHP and I'm kind of new to all this...I would greatly appreciate someone's help over this. Here is my code below (PHP & HTML).
<?php
session_start();
header("Cache-control: private");
$message = "";
$message2 = "";
$message3 = "";
$titleclass = "basictext";
$username = "";
if ($_POST['process'] == 1)
{
if ( (isset($_POST['Title'])) && (!empty($_POST['Title'])) )
{
//if it's all good then redirect...
header("location: abstract_page_2.php");
}
// else put in the error message
$message = "Please enter the TITLE of your presentation.";
$Title = $_POST['Title'];
$emailclass = "errortext";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title></title>
<style>
.basictext {
font-family: Tahoma;
font-size: 12px; color:#431430;
}
body { color: #431430; font-size: 12px; font-family: Tahoma }
p { color: #431430; font-size: 12px; font-family: Tahoma }
td { color: #431430; font-size: 12px; font-family: Tahoma }
.errortext {
font-family: Tahoma;
font-size: 12px; color:#C00000; font-weight: bold;
}
</style>
</head>
<body bgcolor="#ffffff">
<form action="abstract_page_1v2.php" method="post" name="Abstract_Page_1">
<div align="center">
<table width="50%" border="0" cellspacing="1" cellpadding="0" bgcolor="#eb6093">
<tr>
<td>
<table width="60%" border="0" cellspacing="0" cellpadding="5" bgcolor="white">
<tr>
<td colspan="2"><br>
</td>
</tr>
<tr>
<td colspan="2"><img src="images/i_abstract_information.gif" alt="" height="30" width="700" border="0"></td>
</tr>
<tr>
<td width="25%"><br>
</td>
<td><?php if ($message != "") {print '<span class="errortext">'.$message."<span>\n";}?></td>
</tr>
<tr>
<td width="25%"><font color="red" face="Verdana">*</font><font face="Verdana"><b>Title:</b></font></td>
<td><input type="text" name="Title" size="70" maxlength="300" tabindex="1" onchange="javascript:while(''+this.value.charAt(0)==' ')this.value=this.value.substring(1,this.value.length);"></td>
</tr>
<tr>
<td width="25%"><font color="red" face="Verdana">*</font><font face="Verdana"><b>Topic:</b></font></td>
<td><select id="AbstractTopicsID" name="Topic" tabindex="2" onchange="Enable_Other_Topic_Field(this)" ;>
<option value="">- Select a Topic -</option>
<option value="Angiogenesis">Angiogenesis</option>
<option value="Clinical Therapeutics ">Clinical Therapeutics</option>
<option value="Genetics and Imaging">Genetics and Imaging</option>
<option value="Metastasis and Metastatic Disease">Metastasis and Metastatic Disease</option>
<option value="Pathology and Molecular Profiling">Pathology and Molecular Profiling</option>
<option value="Receptors and Hormones ">Receptors and Hormones</option>
<option value="Signal Transduction">Signal Transduction</option>
<option value="Tumor Microenvironment and Cancer Stem Cells ">Tumor Microenvironment and Cancer Stem Cells</option>
<option value="Other topic">Other topic</option>
</select></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td width="25%"><font face="Verdana"><b>Other topic<br>
(please specify):</b></font></td>
<td><input type="text" name="Other_Topic" readonly size="50" maxlength="100" tabindex="3" onchange="javascript:while(''+this.value.charAt(0)==' ')this.value=this.value.substring(1,this.value.length);"></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td width="25%"><font color="red" face="Verdana">*</font><font face="Verdana"><b>Type of presentation:</b></font></td>
<td>
<table width="30%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input onclick="checkBoxValidate(0,1)" type="checkbox" name="Presentation_Type" value="Oral" tabindex="4"><font face="Verdana">Oral</font></td>
<td><input onclick="checkBoxValidate(1,1)" type="checkbox" name="Presentation_Type" value="Poster" tabindex="5"><font face="Verdana">Poster</font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" align="right"><input type="hidden" name="process" value="1">
<table border="0" cellspacing="0" cellpadding="25">
<tr>
<td><input type="image" name="Submit" src="images/continue.gif" alt="" tabindex="7"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</form>
<p></p>
<p></p>
</body>
</html>