2014-03-05 90 views
0

我目前重定向到默認頁面的偉大工程PHP中使用_GET

$WA_redirectURL = "mypage.php"; 

我想插入一個_GET值是有的,但我得到一個語法錯誤,一個變量的redirectUrl語法。這是我正在嘗試的。我認爲這段時間可以讓我把價值進入URL?

$WA_redirectURL = "mypage.php?EmpNumber=". echo $_GET['EmpNumber'] ."; 

回答

8

連接字符串,當你不使用echo

$WA_redirectURL = "mypage.php?EmpNumber=". echo $_GET['EmpNumber'] ."; 

應該是:

$WA_redirectURL = "mypage.php?EmpNumber=". $_GET['EmpNumber']; 

(最後報價也是錯誤的)。

+0

感謝約翰,第二「是問題像你說的! –

1

您使用echo向用戶發送文本。

如果你想連接字符串一起使用期間來加入事情。

例如:

echo "hello"; // this will print hello to the screen 

$testing = "hello "."world!"; 

echo $testing; // this will print hello world! to the screen.