I have a form (profile1.php) that posts to a page (profile2.php). I am utilizing sessions to retain information across pages/forms, as there will be several more after profile2.php. I had it working for awhile, but now I can't post to profile2.php. I get a "The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings."
I see no reason for this. I think it might have something to do with the session_start(); line, because if I comment it out, I can at least post to the page, even though data is not retained beyond that.
I tried experimenting and I can create simple pages to display data across several other pages utilizing the session_start. Something about this particular file is causing a problem, but I can't figure it out.
Usually, if the syntax is bad or there is a punctuation error, I will get a PHP error message. Can anyone see something obvious?
The code for profile2.php follows
<?php
session_start();
// header("Cache-control: private"); /IE 6 Fix
// Get the user's input from the form
$name = $POST['Name'];
$address = $POST['Address'];
$city = $POST['City'];
$phone = $POST['Phone'];
$email = $POST['Email'];
$agency = $POST['Agency'];
$zip = $POST['Zip'];
$type = $POST['Type'];
$required = $POST['required'];
$redirect = $POST['redirect'];
$subject = $POST['subject'];
$recipient = $POST['recipient'];
$toc = $POST['TOC'];
$subjects = $POST['Subjects'];
// Register session key with the value
$SESSION['Name'] = $name;
$SESSION['Address'] = $address;
$SESSION['City'] = $city;
$SESSION['Phone'] = $phone;
$SESSION['Email'] = $email;
$SESSION['Agency'] = $agency;
$SESSION['Zip'] = $zip;
$SESSION['Type'] = $type;
$SESSION['required'] = $required;
$SESSION['redirect'] = $redirect;
$SESSION['subject'] = $subject;
$SESSION['recipient'] = $recipient;
$SESSION['Subjects'] = $subjects;
$SESSION['TOC'] = $toc;
If ($_SESSION['Type'] == "Periodicals") {
echo "
Now, <b>$name</b>, select what you want to track in<b><em> Periodicals</em></b>:
<P>
<form action=\"profile_per.php\" method=\"post\">
<INPUT TYPE=\"hidden\" NAME=\"Name\" VALUE=\"$name\">
<INPUT TYPE=\"hidden\" NAME=\"Agency\" VALUE=\"$agency\">
<INPUT TYPE=\"hidden\" NAME=\"Address\" VALUE=\"$address\">
<INPUT TYPE=\"hidden\" NAME=\"City\" VALUE=\"$city\">
<INPUT TYPE=\"hidden\" NAME=\"Zip\" VALUE=\"$zip\">
<INPUT TYPE=\"hidden\" NAME=\"Phone\" VALUE=\"$phone\">
<INPUT TYPE=\"hidden\" NAME=\"Email\" VALUE=\"$email\">
<INPUT TYPE=\"hidden\" NAME=\"Type\" VALUE=\"$type\">
<INPUT TYPE=\"hidden\" NAME=\"redirect\" VALUE=\"$redirect\">
<INPUT TYPE=\"hidden\" NAME=\"subject\" VALUE=\"$subject\">
<INPUT TYPE=\"hidden\" NAME=\"required\" VALUE=\"$required\">
<INPUT TYPE=\"hidden\" NAME=\"recipient\" VALUE=\"$recipient\">
<b>Table of Contents</b>: Send the current table of contents of the following periodicals as they are published <TEXTAREA NAME=\"Table_of_Contents\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<b>Subjects</b>: Track the following subjects in a database of thousands of periodicals as they are published <TEXTAREA NAME=\"Subjects\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<INPUT TYPE=\"submit\">
";
}
elseif ($_SESSION['Type'] == "State_Information") {
echo "
Now, <b>$name</b>, select what you want to track in <b><em>State_Information</em></b>:
<P>
<form action=\"profile_state.php\" method=\"post\">
<INPUT TYPE=\"hidden\" NAME=\"Name\" VALUE=\"$name\">
<INPUT TYPE=\"hidden\" NAME=\"Agency\" VALUE=\"$agency\">
<INPUT TYPE=\"hidden\" NAME=\"Address\" VALUE=\"$address\">
<INPUT TYPE=\"hidden\" NAME=\"City\" VALUE=\"$city\">
<INPUT TYPE=\"hidden\" NAME=\"Zip\" VALUE=\"$zip\">
<INPUT TYPE=\"hidden\" NAME=\"Phone\" VALUE=\"$phone\">
<INPUT TYPE=\"hidden\" NAME=\"Email\" VALUE=\"$email\">
<INPUT TYPE=\"hidden\" NAME=\"Type\" VALUE=\"$type\">
<INPUT TYPE=\"hidden\" NAME=\"redirect\" VALUE=\"$redirect\">
<INPUT TYPE=\"hidden\" NAME=\"subject\" VALUE=\"$subject\">
<INPUT TYPE=\"hidden\" NAME=\"required\" VALUE=\"$required\">
<b>Bills</b>: <TEXTAREA NAME=\"Bills\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<b>Statutes</b>: <TEXTAREA NAME=\"Statutes\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<b>Regulations</b>: <TEXTAREA NAME=\"Regulations\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<INPUT TYPE=\"submit\">
";
}
elseif ($_SESSION['Type'] == "Federal_Information") {
echo "
Now, <b>$name</b>, select what you want to track in <b><em>Federal Information</em></b>:
<P>
<form action=\"profile_fed.php\" method=\"post\">
<INPUT TYPE=\"hidden\" NAME=\"Name\" VALUE=\"$name\">
<INPUT TYPE=\"hidden\" NAME=\"Agency\" VALUE=\"$agency\">
<INPUT TYPE=\"hidden\" NAME=\"Address\" VALUE=\"$address\">
<INPUT TYPE=\"hidden\" NAME=\"City\" VALUE=\"$city\">
<INPUT TYPE=\"hidden\" NAME=\"Zip\" VALUE=\"$zip\">
<INPUT TYPE=\"hidden\" NAME=\"Phone\" VALUE=\"$phone\">
<INPUT TYPE=\"hidden\" NAME=\"Email\" VALUE=\"$email\">
<INPUT TYPE=\"hidden\" NAME=\"Type\" VALUE=\"$type\">
<INPUT TYPE=\"hidden\" NAME=\"redirect\" VALUE=\"$redirect\">
<INPUT TYPE=\"hidden\" NAME=\"subject\" VALUE=\"$subject\">
<INPUT TYPE=\"hidden\" NAME=\"required\" VALUE=\"$required\">
<b>Legislation</b>: <TEXTAREA NAME=\"Legislations\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<b>Federal Register</b>: <TEXTAREA NAME=\"Federal_Register\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<b>Code of Federal Regulations</b>: <TEXTAREA NAME=\"Code_of_Federal_Regulations\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<INPUT TYPE=\"submit\">
";
}
elseif ($_SESSION['Type'] == "News") {
echo "
Now, <b>$name</b>, select what you want to track in <b><em>News</em></b>:
<P>
<form action=\"profile_news.php\" method=\"post\">
<INPUT TYPE=\"hidden\" NAME=\"Name\" VALUE=\"$name\">
<INPUT TYPE=\"hidden\" NAME=\"Agency\" VALUE=\"$agency\">
<INPUT TYPE=\"hidden\" NAME=\"Address\" VALUE=\"$address\">
<INPUT TYPE=\"hidden\" NAME=\"City\" VALUE=\"$city\">
<INPUT TYPE=\"hidden\" NAME=\"Zip\" VALUE=\"$zip\">
<INPUT TYPE=\"hidden\" NAME=\"Phone\" VALUE=\"$phone\">
<INPUT TYPE=\"hidden\" NAME=\"Email\" VALUE=\"$email\">
<INPUT TYPE=\"hidden\" NAME=\"Type\" VALUE=\"$type\">
<INPUT TYPE=\"hidden\" NAME=\"redirect\" VALUE=\"$redirect\">
<INPUT TYPE=\"hidden\" NAME=\"subject\" VALUE=\"$subject\">
<INPUT TYPE=\"hidden\" NAME=\"required\" VALUE=\"$required\">
<b>Topics</b>: <TEXTAREA NAME=\"Topics\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<b>Sources</b>: <TEXTAREA NAME=\"Sources\" ROWS=3 COLS=60 WRAP=HARD></textarea>
<P />
<INPUT TYPE=\"submit\">
";
}
echo "</FORM>";
?>