是否有辦法將$var
發佈到$PHP_SELF
,以便我可以在腳本中使用它?
經過2個小時,閱讀了幾個問題,它們在右側的邊欄中有用地出現, 很明顯,他們幾乎全部假設HTML表單已經/將會激活 。
但僞〜什麼,我需要的代碼看起來更像是這樣的:
< php
$someVariable=y;
$otherVar=X;
// and the usual setup for accessing the `$_POST` of php:
$HokeyDino=`$_POST`["SendOFF"];
$SendOFF=101;
// etc. and then come to a point where I need the script to just automatically post a value
[ the lack of knowledge ]
// which if I had tha codez!
// would permit the use of that $var, $HokeyDino ...
if($HokeyDino==100){
// do stuff
}
我不喜歡看愚蠢,但要問了,因爲我想我已經錯過了學習編程的一些基本方面,到目前爲止自我教育,但不知道可能缺乏什麼使得很難有效地尋找。
非常感謝!
編輯//說明。
哇,這太神奇了。半小時,24人閱讀這個問題。吹動我的思緒。
對。我已經變得如此之遠做給更多的背景:
它使用的fopen,以動態創建另一個PHP/html頁面,並在Authouring發起腳本所有 代碼,寫(一個PHP腳本+ )到新創建的臨時頁面,整個事情。
從authouring頁面上的一個循環中,我得到了用於檢索我發送到該temp頁面的POSTS的代碼,並且該代碼被寫入了一個非常臨時的頁面...然後我導致頁面的第一部分被寫入,以得到安置臨時頁面上,通過把_
內容等,
接下來,從Authouring頁面上的另一個循環,我寫這逐項其被列入臨時頁面<head>
的東西相匹配代碼。
無論如何,沒有圖形,這有點難以解釋。到目前爲止,我所掌握的是新創建/組裝的Temporary頁面,可以作爲WebPage訪問,點擊一個按鈕,將成功地將值發回原始/ Authouring腳本。
下面是一個棘手的部分:我無法設計任何方式,在AUTHOURING頁面上動態創建代碼,從Temp Page接收POSTS。
但我意識到,如果,在創作頁的循環,我能$PHP SELF
發佈 字符串,它會創建a * $Var = $ POST;
趕上TEMP頁面上從按鈕點擊該數值的代碼,它會工作。
很重要的是,Authoring Page不知道在Temp Page上有多少個按鈕取決於數據庫中的項目數,循環正在讀取哪些按鈕並轉換爲構建的代碼Temp頁面。
因此,在Authouring Page上,沒有辦法在接收帖子時使用所有可能的代碼,但是我可以使用一個通用$Var= $ POST[ X ]
,如果我可以在循環中,在創作頁面。
因此,需要編寫代碼$SELF POST
,並使其僅由正常程序流觸發,而不是單擊窗體中的按鈕。
嗯....清除泥漿呢? :)這個問題還是很直接的。
乾杯!
//// Loop
Create CViewerTemp
read DB and manipulate data
Loop B
create, and write to VeryTempHead page
code which creates the top of CViewer, HEAD items
create, and write to VeryTempBody page
code which will work there, items one by one matching head items
end Loop B
Write code which is 1ne time only stuff, to begin CViewer.
then transfer the stuff from VeryTempHead page, into CViewer, kill
VeryTempHead
then transfer the stuff from VeryTempBody to CViewer, kill Very Temp Body.
Open CTempViwer, click on a Button, a value gets posted to Authouring Page.
Authouring Page doesn't recieve anything, no code to do so exists [YET! :)]
嗯,不知道你的最終目標是什麼。 'SendOFF'從哪裏來,是用戶輸入? – 2012-02-26 21:10:10
「,然後來到我需要腳本自動發佈值的地方」---在哪裏發佈值?到另一個網站? – zerkms 2012-02-26 21:10:57
你不會得到任何幫助這個文本牆 – dynamic 2012-02-26 22:00:47