2016-08-13 3 views

답변

0

그것은 누군가의 index.php에 다음

링크 를 클릭 할 때

<a href="index.php?link=contact_us">Contact Us</a> 

같은

링크 메뉴

선언 링크를 원하는대로 작동 희망

if(isset($_GET['link'])) 
{ 
$link =$_GET['link']; 
    if($link == 'contact_us') 
    { 
     header("location:contact_us.php"); 
    } 
} 
0
//Contact us link 
<a href="index.php?redirect_url=contact_us">Contact Us</a> 

//Javascript code 
function getParameterByName(name, url) { 
    if (!url) url = window.location.href; 
    name = name.replace(/[\[\]]/g, "\\$&"); 
    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 
     results = regex.exec(url); 
    if (!results) return null; 
    if (!results[2]) return ''; 
    return decodeURIComponent(results[2].replace(/\+/g, " ")); 
} 

var redirect_url = getParameterByName('redirect_url'); 

//will redirect to contact us page after 3 seconds. You can change it as per your requirement 
if(redirect_url){ 
    setTimeout(function(){ window.location.href = redirect_url; }, 3000);  
} 
0
<?php 
    /*we will use this this function ob_start() in the first of php page to redirect the users after your submit data 
ob -> output buffering */ 
    ob_start(); 
?> 
<!--for example --> 
<?php 
/*write this function in the first of php page*/ 
ob_start(); 
?> 


<?php 
    /*write your Query here after you write your query you will write the page that you will direct the users for example */ 
     header('location:index.php'); 
    } ?> 
관련 문제