I tried so many things, but theres so many things wrong this code. In the code below, when I run it any access the pay=Impressions page, I press Proceed to Preview but all it does is load the same exact page???!!
<?
// Advertise.php
// for: webewebin.com
// have people advert there site
// Andrew Rosolino
require('info.php');
$total;
$FTR = do_header("","","","2");
if($pay == "Impressions") {
$HDR = do_header("Advertise - Banner Impressions", "", "", "1");
echo $HDR;
?>
<p>We will simply place your banner to the bottom of are page. </p>
<p>We have a deal for only $5.00 will give you 100,000 banner impressions.
The higher you go with the price the more impressions you get!</p>
<?
template_2("","","");
echo $FTR;
} elseif($b == "Proceed to Preview" OR $b == "Preview") {
if(!$title) {
error("You need to enter a name for your Site.");
}
if(!$url) {
error("You need to enter URL for your Site.");
}
if(!$banner) {
error("You need to enter URL for your Banner.");
}
if($select) {
$g = $g + $select;
$rt = split("-", $select);
$p = $rt[0];
$i = $rt[1];
// $sel = format_it("$p");
$h = "\$$p " . "= $i Impressions<br>";
}
// $g = format_it("$g");
$HDR = do_header("Banner Preview", "", "", "1");
echo $HDR;
echo "
<p>You might want to check the banner & link before you submit it</p>
<p><a href=\"$url\" target=_blank><img src=\"$banner\" border=\"0\" alt=\"$title\"></a></p>$h<br><b>Total:</b> \$$g
<p class=\"bigtext\">Edit Banner Info</p>
";
template_2("2", "$i", "$g");
echo $FTR;
}
function template_2($avx, $i, $total) {
echo <<<END
<form method="post">
<table width="450" border="0" cellspacing="1" cellpadding="4">
<tr>
<td width="134" align="right" class="text" valign="middle"><b>Site Title:</b></td>
<td width="347">
<input type="text" name="title" value="$title" maxlength="50" size="30">
</td>
</tr>
<tr>
<td width="134" align="right" class="text" valign="middle"><b>Site URL:</b></td>
<td width="347" class="text">
<input type="text" name="url" value="$url" maxlength="255" size="30">
</td>
</tr>
<tr>
<td width="134" align="right" class="text" valign="middle"><b>Banner URL:</b></td>
<td width="347" class="text">
<input type="text" name="banner" value="$banner" maxlength="255" size="30">
</td>
</tr>
<tr>
<td width="134" align="right" valign="top" class="text"><b>Impressions:</b></td>
<td width="347" class="text">
<select name="select">
END;
$list = array('5.00-100000', '10.00-230000', '15.00-390000', '20.00-500000');
foreach ($list as $line) {
$p = split("-", $line);
if($select == "$p[0]-$p[1]") {
echo "<option value=\"$p[0]-$p[1]\" SELECTED>\$$p[0] ($p[1] Impressions)</option>";
} else {
echo "<option value=\"$p[0]-$p[1]\">\$$p[0] ($p[1] Impressions)</option>";
}
}
echo <<<ENDER
</select>
</td>
</tr>
<tr>
<td width="134" align="right"><b></b></td>
<td width="347">
ENDER;
if($avx == 2) {
echo "<input type=\"submit\" name=\"b\" value=\"Proceed to Pay\"> <input type=\"submit\" name=\"b\" value=\"Preview\">";
} else {
echo "<input type=\"submit\" name=\"b\" value=\"Proceed to Preview\">";
}
echo <<<ENDS
</td>
</tr>
</table>
ENDS;
if($avx == 2) {
echo "* If you change anything above, for it to be changed please press \"Preview\"";
}
echo <<<ENDD
<input type="hidden" name="hits" value="$i">
<input type="hidden" name="total" value="$total">
</form>
ENDD;
}
?>