单击继续作为访客按钮后如何重定向到上一页php

时间:2015-09-10 06:11:26

标签: php

如果我已经登录,我预订了一个页面中的预约将预订..其他明智页面将重定向到登录页面,在登录页面中一个选项如继续作为访客,如果我点击继续作为按钮页面应该重定向相同的操作(具有特定id的预约预约 - 搜索结果的前一个URL)     假设来。使用php

重定向具有以前结果的页面
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>

1 个答案:

答案 0 :(得分:0)

最简单的方法是将结果存储在会话中。您可以在所有页面中访问它
您也可以将其存储在变量中并使其成为url参数 然后,当您重定向到其他页面时,只需在您的网址后面添加参数。