0
我的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中它不是。
在此先感謝。