|
 |
|
บางโฮส ไม่ส่งค่า แก้ไขอย่างไรเหรอครับ เขียนโค้ดแบบนี้นะครับ มันไม่ส่งค่ามาครับ แต่ว่าใช้อีกโฮส ส่งค่าได้ปกติ รบกวนช่วยไขปัญหาด้วยนะครับ |
|
 |
|
|
 |
 |
|
Host นั้นเค้าอาจจะปิด grobal=off ไว้นะครับ
ก้แก้โดย ใช้
echo"$_post[topic]"; การส่งแบบ method post
echo"$_get[topic]"; การส่งแบบ method get
อะไรทำนองนี้แหละครับ
|
 |
 |
 |
 |
Date :
2009-09-23 11:25:28 |
By :
martman26 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตามที่คุณมาร์ทีบอก เอ๊ยคุณมาร์ทบอกอะครับ หรือจะใช้ $_REQUEST ก็ได้ครับ
|
 |
 |
 |
 |
Date :
2009-09-23 11:30:19 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณทุกๆท่านด้วยครับ
เดี่ยวจะลองดูครับ
|
 |
 |
 |
 |
Date :
2009-09-23 11:41:11 |
By :
spybnc |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใส่นี้ข้างบนแทนน่ะครับ
Code (PHP)
<?
//*** Register Global =On/Off Function ***//
$phpVersion = phpversion();
list($v_Upper,$v_Major,$v_Minor) = explode(".",$phpVersion);
if (($v_Upper == 4 && $v_Major < 1) || $v_Upper < 4) {
$_FILES = $HTTP_POST_FILES;
$_ENV = $HTTP_ENV_VARS;
$_GET = $HTTP_GET_VARS;
$_POST = $HTTP_POST_VARS;
$_COOKIE = $HTTP_COOKIE_VARS;
$_SERVER = $HTTP_SERVER_VARS;
$_SESSION = $HTTP_SESSION_VARS;
$_FILES = $HTTP_POST_FILES;
}
if (!ini_get('register_globals')) {
while(list($key,$value)=each($_FILES)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_ENV)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_GET)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_POST)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_COOKIE)) $GLOBALS[$key]=$value;
while(list($key,$value)=each($_SERVER)) $GLOBALS[$key]=$value;
while(list($key,$value)=@each($_SESSION)) $GLOBALS[$key]=$value;
foreach($_FILES as $key => $value){
$GLOBALS[$key]=$_FILES[$key]['tmp_name'];
foreach($value as $ext => $value2){
$key2 = $key."_".$ext;
$GLOBALS[$key2]=$value2;
}
}
}
?>
Ref : PHP register_global = On/Off
|
 |
 |
 |
 |
Date :
2009-09-23 11:51:29 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
นั่นสิครับ คุณ Rastafari ผมเลยสงสัยถึงได้โพสถามไงครับ เจอคนโน้นใช้แบบนี้ เจอคนนี้ใช้อีกแบบนึง เจออีกคนใช้อีกอย่าง ไม่เข้าใจว่ามันมีดี มีเสียอย่างไรครับ แล้วจะเลือกใช้ตัวไหนดีที่สุด
|
 |
 |
 |
 |
Date :
2009-09-23 12:35:25 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วเอามันไปใส่ตรงไหนครับเพ่วิน
|
 |
 |
 |
 |
Date :
2009-09-23 12:36:07 |
By :
NanoTHoro |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
https://www.thaicreate.com/php/forum/032060.html
พยายามเขียนแบบนี้ไว้ให้เคยชิน เพราะแต่ละที่ แต่ละ server จะมีการตั้งค่าไม่เหมือนกัน เราอาจใช้ host นี้แล้วอยู่ดีๆก็อาจไปใช้ที่อื่นวันใดวันหนึ่ง ถ้าไม่เขียนให้ครอบคลุม มันก็จะเป็นอย่างนั้นแหละครับ
|
 |
 |
 |
 |
Date :
2009-09-23 13:32:06 |
By :
mr.v |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$_REQUEST
รับค่าตัวแปรที่ส่งข้อมูลมาด้วย post method หรือ get method หรือจะใช้กับ cookie ก็ได้ รับได้ทุกอย่าง (พี่แคลชวงแบงค์ แป๋ววว)
$_POST
รับค่าตัวแปรที่ส่งข้อมูลมาด้วย post method แบบใหม่ล่าสุด
$HTTP_POST_VAR
รับค่าตัวแปรที่ส่งข้อมูลมาด้วย post method แบบเก่า อยากใช้ได้ไปเปิด register_long_arrays = On
$_GET
รับค่าตัวแปรที่ส่งข้อมูลมาด้วย get method แบบใหม่ล่าสุด
$HTTP_GET_VAR
รับค่าตัวแปรที่ส่งข้อมูลมาด้วย get method แบบเก่า อยากใช้ได้ไปเปิด register_long_arrays = On
ผิดพลาดยังไงช่วยแก้ให้ด้วยนะขอรับ
|
 |
 |
 |
 |
Date :
2009-09-23 13:44:15 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าใน ASP จะใช้ Request("")
หรือ ASP.NET จะใช้ Request.Param("")
|
 |
 |
 |
 |
Date :
2009-09-23 13:48:27 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|