can't get the go back button to diesappear
Posted: Thu Sep 16, 2010 4:15 pm
I'll admit I'm a complete noob and I've been plying with this for the last ... well, long time. There are three error messages which should make a go back button appear - that bit works. If all the requirements are satisfied (ie. there's no need for the go back button to appear) there should just be a message. But, the go back button appears regardless. It's probably something simple in the code, but I'd be grateful if someone could help me out
Code: Select all
echo "<table border=0 width=645>";
echo "<tr><td><input type=button value='<< Go Back' onclick='goBack()'
/></td></tr></table>";
$aprice = $_POST['Price'];
if(empty($aprice))
{
echo("<h5>You didn't AAA</h5>");
$showbutton=1;
}
else
{
}
$aTeacherLang = $_POST['TeacherLang'];
if(empty($aTeacherLang))
{
echo("<h5>You didn't BBB</h5>");
$showbutton=1;
}
else
{
}
$athetime = $_POST['thetime'];
//echo("$athetime");
if(empty($athetime))
{
echo("<h5>You didn't CCC.</h5>");
$showbutton=1;
}
else
{
}
date_default_timezone_set('UTC');
//$today = $today = date("m.d.y");
//print_r($today);
$todays_date = date("Y-m-d");
//print $todays_date;
if ($showbutton=="1")
{
}
else
{
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "<h2>Your advert has been posted - thank you!";
}
mysql_close($con);
?>