<?php 

if(isset($_SESSION['success'])){
    echo '<script>alert("'.$_SESSION['success'].'")</script>';
}

if(isset($_SESSION['error'])){
    echo '<script>alert("'.$_SESSION['error'].'")</script>';
}

?>