2011-04-15 25 views
0

可能重複:
Not able to redirect to next page日食是不是我重定向到下一個頁面

我的PHP代碼如下:

Home.php

<html> 
<form name="Form1" action="Welcome.php" method="post"> 
    Name : <input type="text" name="txtName"> 
    Phone Number : <input type="text" name="txtPhNo"> 
    <input type="submit" name="SubmitIt" value="Submit It">  
</form> 
</html> 

Welcome.php

<?php 
    ob_start(); 
    session_start();  
    if(!($_SESSION['UName'])) 
    { 
     $_SESSION['UName']=$_POST['txtName']; 
    } 
?> 
<html> 
<body> 
Welcome <?php 
    if(isset($_SESSION['UName'])) 
    { 
     echo $_SESSION['UName']; 
    }    
    ?> 
</body> 
</html> 

輸出應該是.....頁面應該重定向到Welcome.php。

但它只顯示空白頁和字符串Welcome.php。

在瀏覽器中它的工作沒有任何問題。但在Eclipse中它不是。

在此先感謝。

回答

1

「瀏覽器輸出」視圖不是瀏覽器。輸出呈現的形式與視圖上的瀏覽器相似,但您無法使用導航(鏈接,表單...)。
使用內部網頁瀏覽器或外部網頁瀏覽器。

相關問題