how to clear server validation
i have a page which shows success or fail using validation
-------------------------------------------------------
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "";
$_SESSION['WAVT_choosegallery_796_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_POST["addGallery"]))?$_POST["addGallery"]:"") . "",false,1);
$WAFV_Errors .= WAValidateUnique("PowerCMSConnection",$PowerCMSConnection,$database_PowerCMSConnection,"gallery","galleryName","',none,''","0","galleryName","',none,''","".(((isset($_POST["addGallery"]))?$_POST["addGallery"]:"")) ."",true,2);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"choosegallery_796");
}
}
?>
-----------------------------------------------------------------
<?php
if ("".((isset($_POST["addGallery"]))?$_POST["addGallery"]:"") ."" != "".$row_gallery_insert['galleryName'] ."") { // WebAssist Show If
?>
<div id="success"> Success That gallery ( <?php echo $row_gallery_insert['galleryName']; ?> ) has been created</div>
<?php
if (ValidatedField('choosegallery_796','choosegallery_796')) {
if ((strpos((",".ValidatedField("choosegallery_796","choosegallery_796").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?>
<div id="error">Error, that gallery ( <?php echo $row_gallery_insert['galleryName']; ?> ) allready exists!</div>
<?php //WAFV_Conditional choose_gallery.php choosegallery_796(2:)
}
}
}?>
<?php
} // ("".((isset($_POST["addGallery"]))?$_POST["addGallery"]:"") ."" != "".$row_gallery_insert['galleryName'] ."")
?>
<?php
if (ValidatedField('choosegallery_796','choosegallery_796')) {
if ((strpos((",".ValidatedField("choosegallery_796","choosegallery_796").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<div id="error"> Error, you must at least enter a gallery name. <br />
You can edit the comment for the gallery later!</div>
<?php //WAFV_Conditional choose_gallery.php choosegallery_796(1:)
}
}
}?>
--------------------------------------------------------------------
how do i not have them show when add button is pressed or the user goes to new page then back to that page