loadTemplateFile("contactus.tpl",true,true); $tpl->setVariable("header",$header); $tpl->setVariable("left",$left); $tpl->setVariable("right",$right); $tpl->setVariable("footer",$footer); ############# COUNTRY ################# $sql = "select * from country"; $run = mysql_query($sql); if(!isset($_SESSION['country'])) { $_SESSION['country']="220"; } $tpl->setCurrentBlock("COUNTRY"); while($row_data = mysql_fetch_array($run)) { $tpl->setVariable("country_id",$row_data['country_id']); $tpl->setVariable("country_name" , $row_data['country_name']); if($_SESSION['country']== $row_data['country_id']) { $tpl->setVariable('select1',"selected=selected"); } $tpl->parseCurrentBlock("COUNTRY"); } ############# FORM ACTION LINK #################### $tpl->setVariable("contactus",$contact_us); ############## CHECKING IF THERE IS AN ERROR OR SUCCESS ################ if(isset($_SESSION['msg1'])) { $tpl->setVariable("msg1",$_SESSION['msg1']); unset($_SESSION['msg1']); } else $tpl->setVariable("msg1",""); ################ ON ERROR HOLDING FIELD VALUES ############## if($_SESSION['error'] == "yes") { $tpl->setVariable("name",$_SESSION['name']); $tpl->setVariable("city",$_SESSION['city']); $tpl->setVariable("state",$_SESSION['state']); $tpl->setVariable("country",$_SESSION['country']); $tpl->setVariable("phone",$_SESSION['phone']); $tpl->setVariable("email",$_SESSION['email']); ################ REMOVING SESSION VALUES ################# unset($_SESSION['name']); unset($_SESSION['city']); unset($_SESSION['state']); unset($_SESSION['country']); unset($_SESSION['phone']); unset($_SESSION['email']); } $tpl->show(); ?>