0
恆定值,這基本上是一個Ajax響應我要指派從配置文件位置我都存儲在不斷我該如何分配PHP定義腳本
define(BASE_URL, "http://example.net/lc-latest/");
$website = BASE_URL ;
這是我的示例頁面代碼的腳本:
if (response["success"] == true) {
$("#showMessage").html(response['message']);
location = "/lc-latest/gdpi.php?jobid="+response["id"]
/* I want to re write this link as `$website` so that if I changed
the project location it should not disturb.*/
location = "<?php BASE_URL ?>gdpi.php?jobid="+response["id"] //can i write like this in script of ajax response.?
window.open(location);
}
如果你改變了項目的位置,你不能只是改變你的定義語句? –
@RossWilson是的,我會改變定義,我問我如何給base_url作業頁面scrpt ..? –
'<?php echo BASE_URL?>'應該可以工作 – FrankerZ