1 頁 (共 1 頁)

[討論] 問一個 php 的寫法

發表於 : 2004-06-23 12:31
天霜
A會員瀏覽A會員的公開個人資料時 則就出現一個用<table>語法的表格\r

如果是非A會員瀏覽A會員的公開個人資料時 則就不會出現一個<table>語法的表格\r

換句話說 就是自己瀏覽自己的公開資料時才會出現一個看板訊息\r

請問這要如何寫?

發表於 : 2004-06-23 13:37
Mac
應該是用 $userdata['user_id'] 來做瀏覽人的 ID
如果 $postrow['user_id'] 是被瀏覽人 ID 的:

代碼: 選擇全部

if ( $userdata['user_id'] == $postrow['user_id'] )
{
   ...
}
~Mac

發表於 : 2004-06-23 17:28
天霜
喔~ 那我大約知道要怎麼寫了 :-P
我就是不知道 if 要判斷什麼程式碼... :oops:

發表於 : 2004-06-23 23:45
天霜
應該是這樣...

因為是在公開個人資料(viewprofile)

代碼: 選擇全部

if ( $userdata['user_id'] == $[color=red]profiledata[/color]['user_id'] ) 
{ 
   ... 
}
終於達成我要的效果了~

謝謝 Mac 及 yuna 的大力幫忙 :-P

發表於 : 2004-06-24 09:15
Mac
這個 row / postrow / profiledata 到底要用什麼全看你要改的檔案中,SQL 取出的資料名稱用的是那個

~Mac