2017-05-05 70 views
-3

重定向到一個特定的頁面

`<!DOCTYPE html> 
 
<html class="no-js"> 
 
    <head> 
 
     <!-- Basic Page Needs 
 
     ================================================== --> 
 
     <meta charset="utf-8"> 
 
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
 
     <link rel="icon" type="image/png" href="images/favicon.png"> 
 
     <title>Timer Agency Template</title> 
 
     <meta name="description" content=""> 
 
     <meta name="keywords" content=""> 
 
     <meta name="author" content=""> 
 
     <!-- Mobile Specific Metas 
 
     ================================================== --> 
 
     <meta name="format-detection" content="telephone=no"> 
 
     <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
     
 
     <!-- Template CSS Files 
 
     ================================================== --> 
 
     <!-- Twitter Bootstrs CSS --> 
 
     <link rel="stylesheet" href="css/bootstrap.min.css"> 
 
     <!-- Ionicons Fonts Css --> 
 
     <link rel="stylesheet" href="css/ionicons.min.css"> 
 
     <!-- animate css --> 
 
     <link rel="stylesheet" href="css/animate.css"> 
 
     <!-- Hero area slider css--> 
 
     <link rel="stylesheet" href="css/slider.css"> 
 
     <!-- owl craousel css --> 
 
     <link rel="stylesheet" href="css/owl.carousel.css"> 
 
     <link rel="stylesheet" href="css/owl.theme.css"> 
 
     <link rel="stylesheet" href="css/jquery.fancybox.css"> 
 
     <!-- template main css file --> 
 
     <link rel="stylesheet" href="css/main.css"> 
 
     <!-- responsive css --> 
 
     <link rel="stylesheet" href="css/responsive.css"> 
 
     
 
     <!-- Template Javascript Files 
 
     ================================================== --> 
 
     <!-- modernizr js --> 
 
     <script src="js/vendor/modernizr-2.6.2.min.js"></script> 
 
     <!-- jquery --> 
 
     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 
 
     <!-- owl carouserl js --> 
 
     <script src="js/owl.carousel.min.js"></script> 
 
     <!-- bootstrap js --> 
 

 
     <script src="js/bootstrap.min.js"></script> 
 
     <!-- wow js --> 
 
     <script src="js/wow.min.js"></script> 
 
     <!-- slider js --> 
 
     <script src="js/slider.js"></script> 
 
     <script src="js/jquery.fancybox.js"></script> 
 
     <!-- template main js --> 
 
     <script src="js/main.js"></script> 
 
    </head> 
 
    <body> 
 
     <!-- 
 
     ================================================== 
 
     Header Section Start 
 
     ================================================== --> 
 
     <header id="top-bar" class="navbar-fixed-top animated-header"> 
 
      <div class="container"> 
 
       <div class="navbar-header"> 
 
        <!-- responsive nav button --> 
 
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> 
 
        <span class="sr-only">Toggle navigation</span> 
 
        <span class="icon-bar"></span> 
 
        <span class="icon-bar"></span> 
 
        <span class="icon-bar"></span> 
 
        </button> 
 
        <!-- /responsive nav button --> 
 
        
 
        <!-- logo --> 
 
        <div class="navbar-brand"> 
 
         <a href="index.html" > 
 
          <img src="images/logo.png" alt=""> 
 
         </a> 
 
        </div> 
 
        <!-- /logo --> 
 
       </div> 
 
       <!-- main menu --> 
 
       <nav class="collapse navbar-collapse navbar-right" role="navigation"> 
 
        <div class="main-menu"> 
 
         <ul class="nav navbar-nav navbar-right"> 
 
          <li> 
 
           <a href="index.html" >Home</a> 
 
          </li> 
 
          <li><a href="about.html">Sign Up</a></li> 
 
          <li><a href="service.html">Log In</a></li> 
 
          
 
          <li><a href="contact.html">Contact</a></li> 
 
         </ul> 
 
        </div> 
 
       </nav> 
 
       <!-- /main nav --> 
 
      </div> 
 
     </header> 
 
     
 
     <!-- 
 
     ================================================== 
 
     Slider Section Start 
 
     ================================================== --> 
 
     <section id="hero-area" > 
 
      <div class="container"> 
 
       <div class="row"> 
 
        <div class="col-md-12 text-center"> 
 
         <div class="block wow fadeInUp" data-wow-delay=".3s"> 
 
          
 
          <!-- Slider --> 
 
          <section class="cd-intro"> 
 
           <h1 class="wow fadeInUp animated cd-headline slide" data-wow-delay=".4s" > 
 
           <span>EMPLOYEE TRAINING PROGRAMME</span><br> 
 
           <span class="cd-words-wrapper"> 
 
            <b class="is-visible">(ETP)</b> 
 
            <b>DEVELOPER</b> 
 
            <b>FATHER</b> 
 
           </span> 
 
           </h1> 
 
           </section> <!-- cd-intro --> 
 
           <!-- /.slider --> 
 
           
 
           <a class="btn-lines dark light wow fadeInUp animated smooth-scroll btn btn-default btn-green" data-wow-delay=".9s" href="#works" data-section="#works" >View Programmes</a> 
 
           
 
          </div> 
 
         </div> 
 
        </div> 
 
       </div> 
 
      </section><!--/#main-slider--> 
 
      <!-- 
 
      ================================================== 
 
      Slider Section Start 
 
      ================================================== --> 
 
      <section id="about"> 
 
       <div class="container"> 
 
        <div class="row"> 
 
         <div class="col-md-6 col-sm-6"> 
 
          <div class="block wow fadeInLeft" data-wow-delay=".3s" data-wow-duration="500ms"> 
 
           <h2> 
 
           ABOUT THE COMPANY 
 
           </h2> 
 
           <p> 
 
            Persistent Systems is a technology services company which was incorporated on 16 May 1990 as Persistent Systems Private Limited. It was subsequently converted into a public Limited company on 17 September 2010 with the name Persistent Systems Limited and a new certificate of incorporation was issued on 28 September 2007 from the RoC. 
 
           </p> 
 
           </div> 
 
          
 
         </div> 
 
         <div class="col-md-6 col-sm-6"> 
 
          <div class="block wow fadeInRight" data-wow-delay=".3s" data-wow-duration="500ms"> 
 
           <img src="images/about/about.jpg" alt=""> 
 
          </div> 
 
         </div> 
 
        </div> 
 
       </div> 
 
      </section> <!-- /#about --> 
 
      <!-- 
 
      ================================================== 
 
      Portfolio Section Start 
 
      ================================================== --> 
 
      <section id="works" class="works"> 
 
       <div class="container"> 
 
        <div class="section-heading"> 
 
         <h1 class="title wow fadeInDown" data-wow-delay=".3s">Available Programmes</h1> 
 
         <p class="wow fadeInDown" data-wow-delay=".5s"> 
 
          The following programmes are available for our employees.. 
 
         </p> 
 
        </div> 
 
        <div class="row"> 
 
         <div class="col-sm-4 col-xs-12"> 
 
          <figure class="wow fadeInLeft animated portfolio-item" data-wow-duration="500ms" data-wow-delay="0ms"> 
 
           <div class="img-wrapper"> 
 
            <img src="images/portfolio/item-1.jpg" class="img-responsive" alt="this is a title" > 
 
            <div class="overlay"> 
 
             <div class="buttons"> 
 
              <a target="_blank" href="service.html">Enroll for Selenium</a> 
 
             </div> 
 
            </div> 
 
           </div> 
 
           <figcaption> 
 
           <h4> 
 
           <a href="#"> 
 
            Selenium 
 
           </a> 
 
           </h4> 
 
           <p> 
 
            Automated software testing tool 
 
           </p> 
 
           </figcaption> 
 
          </figure> 
 
         </div> 
 
         <div class="col-sm-4 col-xs-12"> 
 
          <figure class="wow fadeInLeft animated" data-wow-duration="500ms" data-wow-delay="300ms"> 
 
           <div class="img-wrapper"> 
 
            <img src="images/portfolio/item-2.jpg" class="img-responsive" alt="this is a title" > 
 
            <div class="overlay"> 
 
             <div class="buttons"> 
 
              <a target="_blank" href="service.html">Enroll for Robotium</a> 
 
             </div> 
 
            </div> 
 
           </div> 
 
           <figcaption> 
 
           <h4> 
 
           <a href="#"> 
 
            Robotium 
 
           </a> 
 
           </h4> 
 
           <p> 
 
Automation testing framework (Android)        </p> 
 
           </figcaption> 
 
          </figure> 
 
         </div> 
 
         <div class="col-sm-4 col-xs-12"> 
 
          <figure class="wow fadeInLeft animated" data-wow-duration="500ms" data-wow-delay="300ms"> 
 
           <div class="img-wrapper"> 
 
            <img src="images/portfolio/item-3.jpg" class="img-responsive" alt="" > 
 
            <div class="overlay"> 
 
             <div class="buttons"> 
 
              <a target="_blank" href="service.html">Enroll for TestComplete</a> 
 
             </div> 
 
            </div> 
 
           </div> 
 
           <figcaption> 
 
           <h4> 
 
           <a href="#"> 
 
            TestComplete 
 
           </a> 
 
           </h4> 
 
           <p> 
 
            Open testing platform 
 
           </p> 
 
           </figcaption> 
 
          </figure> 
 
         </div> 
 
         <div class="col-sm-4 col-xs-12"> 
 
          <figure class="wow fadeInLeft animated" data-wow-duration="500ms" data-wow-delay="600ms"> 
 
           <div class="img-wrapper"> 
 
            <img src="images/portfolio/item-4.jpg" class="img-responsive" alt="" > 
 
            <div class="overlay"> 
 
             <div class="buttons"> 
 
              <a target="_blank" href="service.html">Enroll for SoapUI</a> 
 
             </div> 
 
            </div> 
 
           </div> 
 
           <figcaption> 
 
           <h4> 
 
           <a href="#"> 
 
            SoapUI 
 
           </a> 
 
           </h4> 
 
           <p> 
 
            Web service testing application 
 
           </p> 
 
           </figcaption> 
 
          </figure> 
 
         </div> 
 
         <div class="col-sm-4 col-xs-12"> 
 
          <figure class="wow fadeInLeft animated" data-wow-duration="500ms" data-wow-delay="900ms"> 
 
           <div class="img-wrapper"> 
 
            <img src="images/portfolio/item-5.jpg" class="img-responsive" alt="" > 
 
            <div class="overlay"> 
 
             <div class="buttons"> 
 
              <a target="_blank" href="service.html">Enroll for QTP(HP)</a> 
 
             </div> 
 
            </div> 
 
           </div> 
 
           <figcaption> 
 
           <h4> 
 
           <a href="#"> 
 
            QTP 
 
           </a> 
 
           </h4> 
 
           <p> 
 
            Automated functional testing tool 
 
           </p> 
 
           </figcaption> 
 
          </figure> 
 
         </div> 
 
         <div class="col-sm-4 col-xs-12"> 
 
          <figure class="wow fadeInLeft animated" data-wow-duration="500ms" data-wow-delay="1200ms"> 
 
           <div class="img-wrapper"> 
 
            <img src="images/portfolio/item-6.jpg" class="img-responsive" alt="" > 
 
            <div class="overlay"> 
 
             <div class="buttons"> 
 
              <a target="_blank" href="service.html">Enroll for TestDrive</a> 
 
             </div> 
 
            </div> 
 
           </div> 
 
           <figcaption> 
 
           <h4> 
 
           <a href="#"> 
 
            TestDrive 
 
           </a> 
 
           </h4> 
 
           <p> 
 
            Automated software quality solution 
 
           </p> 
 
           </figcaption> 
 
          </figure> 
 
         </div> 
 
        </div> 
 
       </div> 
 
      </section> <!-- #works --> 
 
      <!-- 
 
      ================================================== 
 
      Portfolio Section Start 
 
      ================================================== --> 
 
      <section id="feature"> 
 
       <div class="container"> 
 
        <div class="section-heading"> 
 
         <h1 class="title wow fadeInDown" data-wow-delay=".3s">BENEFITS</h1> 
 
         <p class="wow fadeInDown" data-wow-delay=".5s"> 
 
          The benefits of the programme are clearly very high.<br>The programme empowers you with new ways for quality software development. 
 
         </p> 
 
        </div> 
 
        <div class="row"> 
 
         <div class="col-md-4 col-lg-4 col-xs-12"> 
 
          <div class="media wow fadeInUp animated" data-wow-duration="500ms" data-wow-delay="300ms"> 
 
           <div class="media-left"> 
 
            <div class="icon"> 
 
             <i class="ion-ios-flask-outline"></i> 
 
            </div> 
 
           </div> 
 
           <div class="media-body"> 
 
            <h4 class="media-heading">Better product quality 
 
</h4> 
 
<p>After the programme,the products you generate will see a rise in quality.</p> 
 
            
 
           </div> 
 
          </div> 
 
         </div> 
 
         <div class="col-md-4 col-lg-4 col-xs-12"> 
 
          <div class="media wow fadeInDown animated" data-wow-duration="500ms" data-wow-delay="600ms"> 
 
           <div class="media-left"> 
 
            <div class="icon"> 
 
             <i class="ion-ios-lightbulb-outline"></i> 
 
            </div> 
 
           </div> 
 
           <div class="media-body"> 
 
            <h4 class="media-heading">Client satisfaction 
 
</h4> 
 
            <p>Better quality products will automatically lead to better client satisfaction</p> 
 
           </div> 
 
          </div> 
 
         </div> 
 
         <div class="col-md-4 col-lg-4 col-xs-12"> 
 
          <div class="media wow fadeInDown animated" data-wow-duration="500ms" data-wow-delay="900ms"> 
 
           <div class="media-left"> 
 
            <div class="icon"> 
 
             <i class="ion-ios-lightbulb-outline"></i> 
 
            </div> 
 
           </div> 
 
           <div class="media-body"> 
 
            <h4 class="media-heading">Work reduction 
 
</h4> 
 
            <p>The programme will allow you to generate products in a complete new mannner thus reducing your work.</p> 
 
           </div> 
 
          </div> 
 
         </div> 
 
         <div class="col-md-4 col-lg-4 col-xs-12"> 
 
          <div class="media wow fadeInDown animated" data-wow-duration="500ms" data-wow-delay="1200ms"> 
 
           <div class="media-left"> 
 
            <div class="icon"> 
 
             <i class="ion-ios-americanfootball-outline"></i> 
 
            </div> 
 
           </div> 
 
           <div class="media-body"> 
 
            <h4 class="media-heading">Easier development 
 
</h4> 
 
            <p>Development of new products will now be easier than ever before.</p> 
 
           </div> 
 
          </div> 
 
         </div> 
 
         <div class="col-md-4 col-lg-4 col-xs-12"> 
 
          <div class="media wow fadeInDown animated" data-wow-duration="500ms" data-wow-delay="1500ms"> 
 
           <div class="media-left"> 
 
            <div class="icon"> 
 
             <i class="ion-ios-keypad-outline"></i> 
 
            </div> 
 
           </div> 
 
           <div class="media-body"> 
 
            <h4 class="media-heading">Increased work rate 
 
</h4> 
 
            <p>New methods will allow you to work at a faster pace thus increasing your work rate.</p> 
 
           </div> 
 
          </div> 
 
         </div> 
 
         <div class="col-md-4 col-lg-4 col-xs-12"> 
 
          <div class="media wow fadeInDown animated" data-wow-duration="500ms" data-wow-delay="1800ms"> 
 
           <div class="media-left"> 
 
            <div class="icon"> 
 
             <i class="ion-ios-barcode-outline"></i> 
 
            </div> 
 
           </div> 
 
           <div class="media-body"> 
 
            <h4 class="media-heading">Skill upgradation</h4> 
 
            <p>Last but not the least,you will have a new set of skills completely industry relevant.</p> 
 
           </div> 
 
          </div> 
 
         </div> 
 
        </div> 
 
       </div> 
 
      </section> <!-- /#feature --> 
 
          
 
      <!-- 
 
      ================================================== 
 
      Call To Action Section Start 
 
      ================================================== --> 
 
      <section id="call-to-action"> 
 
       <div class="container"> 
 
        <div class="row"> 
 
         <div class="col-md-12"> 
 
          <div class="block"> 
 
           <h2 class="title wow fadeInDown" data-wow-delay=".3s" data-wow-duration="500ms">STILL THINKING?</h1> 
 
           <p class="wow fadeInDown" data-wow-delay=".5s" data-wow-duration="500ms">Stop thinking. Begin now. The later you begin, the more you will be left behind.</p> 
 
           <a href="contact.html" class="btn btn-default btn-contact wow fadeInDown" data-wow-delay=".7s" data-wow-duration="500ms">Contact With Me</a> 
 
          </div> 
 
         </div> 
 
         
 
        </div> 
 
       </div> 
 
      </section> 
 
      <!-- 
 
      ================================================== 
 
      Footer Section Start 
 
      ================================================== --> 
 
      <footer id="footer"> 
 
       <div class="container"> 
 
        <div class="col-md-8"> 
 
         <p class="copyright">Copyright: <span>2015</span> . `enter code here`Design and Developed by <a href="http://www.Themefisher.com">Themefisher</a></p> 
 
        </div> 
 
        <div class="col-md-4"> 
 
         <!-- Social Media --> 
 
         <ul class="social"> 
 
          <li> 
 
           <a href="https://www.facebook.com/PersistentSystems/" target="_blank"class="Facebook"> 
 
            <i class="ion-social-facebook"></i> 
 
           </a> 
 
          </li> 
 
          <li> 
 
           <a href="https://twitter.com/Persistentsys?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor" target="_blank" class="Twitter"> 
 
            <i class="ion-social-twitter"></i> 
 
           </a> 
 
          </li> 
 
          <li> 
 
           <a href="https://www.linkedin.com/company/persistent-systems" class="Linkedin" target="_blank"> 
 
            <i class="ion-social-linkedin"></i> 
 
           </a> 
 
          </li> 
 
          
 
         </ul> 
 
        </div> 
 
       </div> 
 
      </footer> <!-- /#footer --> 
 
       
 
     </body> 
 
    </html>

我目前的工作,如果用戶想註冊一個特定的程序上登記的用戶點擊其中一個web項目,他們將被重定向到登錄頁面。但我希望他們應該被自動重定向到他們的個人資料頁面,如果他們已經登錄。我該怎麼做。另外我是一個新手來stackoverflow,所以我不知道如何在這裏呈現我的代碼。如果有人會告訴我如何做到這一點,我完全樂意做到這一點。

+2

您需要代碼和更多信息;複製並粘貼代碼,並告訴我們您使用哪種語言編寫了身份驗證。 – AdamMcquiff

+0

Avinash請先提及您的代碼 – kevin

+0

點擊帖子編輯器中的「問號」圖標,以獲取有關如何正確輸入代碼的信息。 –

回答

0

如果用戶登錄到您的網站,您必須使用PHP進行測試。

session_start(); 
if(isset($_SESSION['isLogged'])){ 
    header('Location: profil.php'); 
    exit; 
} 
else { 
    header('Location: login.php'); 
    exit; 
} 

我想你不知道很多PHP,所以你應該看看如何創建一個成員,並使用PHP會議:-)

https://code.tutsplus.com/tutorials/user-membership-with-php--net-1523

+1

爲什麼你認爲他首先使用PHP(或想要使用)? –

+0

90%的新網站開發人員使用PHP來學習創建類似博客或簡單的會員資格。 Op沒有提供更多的信息,所以它可能是PHP,但邏輯仍然是一樣的。 –

0

以及您需要檢查你的會話或如果cookie存在,並沒有過期....如果他們存在,然後你在整個頁面加載之前重定向(服務器邏輯)...因爲我不知道你寫了你的語言服務器邏輯我不能幫助你帶密碼

0

使用後r已登錄生成用戶令牌並將其存儲在cookie中,當用戶重定向到登錄頁面時使用jquery/javascript檢查cookie,然後從那裏您可以決定用戶是否應該停留在登錄頁面或重定向到配置文件頁面。 您可以通過粘貼在編輯器中發佈您的代碼並選擇代碼,然後單擊{}此符號