I have a project for school. The group leader requested I use PHP although I have never used PHP. I have a simple html form page and when the submit button is clicked, a page pops up showing the users confirmation number and spits back the infor. that filled out in the form. I need the source code on how to get that confirmation page using PHP.
Well you can't make a page "pop-up" with PHP, you'll need Javascript for that.
But to do it with PHP, its really easy. Here's an example:
PHP Code:
<?php
if($_GET['continue'] != 1)
{
// form items you wish to exclude from the info list. you can just make this blank if you dont want to exclude anything
$exclude = array('submit','hiddenvalue');
foreach($_POST as $key => $val)
{
// if its in the exclude array, skip it
if(in_array($val, $exclude))
continue;
// print out the info
echo $key.": ".$val."<br />\n";
}
?>
<br /><br />
<li><a href="<?=$_SERVER['PHP_SELF']?>?continue=1">Yes, this information is correct</a></li>
<li><a href="javascript:history.go(-1);">No, this information is not correct. (Go back)</a></li>
<?
}
else
{
// do your "its confirmed code"
// for example, forward the user to a page (uncomment the line):
// header("Location: http://url.com");
}