php program not working!

I can’t get this to show my contacts can someone help!! :-[

<?php //check for required query string variables if (!$_GET[id]) { header("Location:contact_menu.php"); exit; } else { //if form variables are present,start a session session_start(); } //check for validity of user if ($_SESSION[valid] != "yes") { header("Location:contact_menu.php"); exit; } //set up table and database names $db_name ="any"; $table_name ="any"; //connect to server and select database $connection = @mysql_connect("localhost","any","any") or die(mysql_error()); $db = @mysql_select_db($db_name,$connection) or die(mysql_error()); //build and issue query $chk_id = "SELECT id FROM $table_name WHERE id ='$_GET[id]'"; $chk_id_res = @mysql_query($chk_id,$connection) or die(mysql_error()); $chk_id_num = mysql_num_rows($chk_id_res); //check for valid results if ($chk_id_num !=0){ //if not valid,redirect to menu header("Location:contact_menu.php"); exit; } else { //if valid,get information $sql ="SELECT f_name, l_name, address1, address2, address3, postcode, country, prim_tel, sec_tel, email, birthday FROM $table_name WHERE id ='$_GET[id]'"; $result = @mysql_query($sql,$connection) or die(mysql_error()); //get results for display while ($row =mysql_fetch_array($result)) { $f_name = $row['f_name']; $l_name = $row['l_name']; $address1 = $row['address1']; $address2 = $row['address2']; $address3 = $row['address3']; $postcode = $row['postcode']; $country = $row['country']; $prim_tel = $row['prim_tel']; $sec_tel = $row['sec_tel']; $email = $row['email']; $birthday = $row['birthday']; } } ?> My Contact Management System: Read-Only Contact Details

My Contact Management System

Contact Details for <?php echo "$f_name $l_name"; ?>

Name & Address:
<?php echo "$f_name $l_name"; ?>
<?php if ($address1 != "") { echo "$address1
"; }

if ($address2 != “”) {
echo "$address2
";
}

if ($address3 != “”) {
echo "$address3
";
}

if ($postcode != “”) {
echo "$postcode
";
}

if ($country != “”) {
echo "$country
";
}
?>

<?php

if ($prim_tel != “”) {
echo "Tel 1: $prim_tel
";
}

if ($sec_tel != “”) {
echo "Tel 2: $sec_tel
";
}

if ($email != “”) {
echo “E-Mail: <a href=“mailto:$email”>$email
”;
}

?>

<?php if ($birthday != "0000-00-00") { echo "

Birthday: $birthday

"; } ?>

Return to Main Menu

Sponsor our Newsletter | Privacy Policy | Terms of Service