Пример #1
0
}
// use contact id in session variable in the delete contact method
if (isset($_POST['delete_contact'])) {
    $transfer = $_SESSION['transfer'];
    $new = new contacts('', '', '', '', '', '', '');
    //$new = new contacts($_POST['fname'],$_POST['lname'],$_POST['email'],$_POST['mobile'],$_POST['home'],$_POST['street'],$_POST['city']);
    $new->delete_contact();
    header("Location: page_read.php");
}
//acquire contact id from the get method and insert into a session variable  to be used for the auto fill method
if (isset($_GET['transfer'])) {
    $_SESSION['transfer'] = $_GET['transfer'];
    $transfer = $_SESSION['transfer'];
    echo $_SESSION['transfer'];
    $new = new contacts('', '', '', '', '', '', '');
    $new->auto_fill();
    list($fname, $lname, $email, $mobile, $home, $street, $city) = $new->auto_fill();
    if ($mobile == 0) {
        $mobile = "";
    }
    if ($home == 0) {
        $home = "";
    }
    if ($home == 0 && $street == 0 && $city == 0) {
        $home = "";
        $street = "";
        $city = "";
    }
    $_SESSION['fname'] = $fname;
    $_SESSION['lname'] = $lname;
    $_SESSION['email'] = $email;