Following is my code:
appointment.php:
<?php session_start();
ini_set("display_errors",1);
include("config.php");
$Doctor = $_GET['strdoc1'];
$my_data=mysql_real_escape_string($Doctor);
$sql="SELECT E.EMPLOYEE_ID,E.FIRST_NAME,E.LAST_NAME,E.EMPLOYEE_EMAIL,E.PHONE_NUMBER,E.MOBILE_NUMBER, E.USER_IMAGE,
E.EMPLOYEE_EDUCATION,E.EMPLOYEE_SPECIALIZATION,E.EMPLOYEE_EXPERIENCE,
EA.APARTMENT,EA.DOOR_NO,EA.STREET,EA.AREA,EA.LANDMARK,
EU.EMP_UNIT_ID,EU.EMPLOYEE_IN_TIME,EU.EMPLOYEE_OUT_TIME,
U.UNIT_ID,U.UNIT_TITLE,U.UNIT_ADDRESS1,U.UNIT_ADDRESS2,U.UNIT_STREET,U.UNIT_AREA,CO.COUNTRY_TITLE,S.STATES_TITLE,C.CITY_TITLE,
U.UNIT_LANDMARK,U.UNIT_POSTAL_CODE,U.UNIT_PHONE_NUMBER1,U.UNIT_PHONE_NUMBER2,U.UNIT_FAX_NUMBER,U.UNIT_CONTACT_EAMIL
FROM EMPLOYEE_UNIT EU
INNER JOIN EMPLOYEE E on E.EMPLOYEE_ID=EU.EMPLOYEE_ID
INNER JOIN UNIT U on U.UNIT_ID=EU.UNIT_ID
INNER JOIN EMPLOYEE_ADDRESS EA ON E.EMPLOYEE_ID = EA.EMPLOYEE_ID
INNER JOIN COUNTRY CO ON U.COUNTRY_ID=CO.COUNTRY_ID
INNER JOIN STATES S ON U.STATES_ID = S.STATES_ID
INNER JOIN CITY C ON U.CITY_ID=C.CITY_ID
WHERE EU.EMP_UNIT_ID = '$my_data'";
$result = mysql_query($sql) or die(mysql_error());
$row=mysql_fetch_array($result);
$query="SELECT DISTINCT UNIT_AREA FROM UNIT";
$result1=mysql_query($query);
$patient="SELECT * FROM PATIENT WHERE PATIENT_ID='".$_SESSION['PATIENT_ID']."'";
$r=mysql_query($patient);
$ps=mysql_fetch_array($r);
?>
<?php if($_SESSION['PATIENT_ID']) { ?>
<a href="appointment" class="appointment" title="Book Appointment">Book Appointment</a>
<?php } else { ?>
<a href="login" class="appointment" title="Book Appointment">Book Appointment</a>
<?php } ?>
login .php:
<a href="signin.php">New Patient Registration</a><a href="">Continue As a Guest</a>
</div>
答案 0 :(得分:0)
最简单的方法是将结果存储在会话中。您可以在所有页面中访问它
您也可以将其存储在变量中并使其成为url参数
然后,当您重定向到其他页面时,只需在您的网址后面添加参数。