|
 |
|
ผมมีปัญาเกี่ยวกับการใช้ $_GET ครับ เนื่องจากผมเขียนโปรแกรมบน OS windows โปรแกรมสมบูรณ์แล้ว ใช้ได้ทุกคำสั่ง |
|
 |
|
|
 |
 |
|
โฮสท์กำหนด register_global เป็น off
แก้โดยการ
ini_set('register_globals', 'on');
เอาไว้บนสุดของโค้ดครัล
|
 |
 |
 |
 |
Date :
2009-10-09 17:11:30 |
By :
danya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่รุ้ สิ่งที่ผมเดา นั้นถุกหรือเปล่า หุหุ
|
 |
 |
 |
 |
Date :
2009-10-09 17:15:27 |
By :
danya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วทำไมบนเครื่องที่เป็น OS windows ถึงทำงานได้หมด แต่เครื่องที่เป็น OS Fedora ถึงทำงานได้ไม่หมด
|
 |
 |
 |
 |
Date :
2009-10-09 17:29:01 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ในเครื่องที่เราใช้งาน เราจะลง appserv เองใช้ไหมครับ
ซึ่งค่าปกติค่า register_global = On
แต่บ้างhost หรือ server ค่า register_global = Off
อยากรู้ว่า on / off
ก็สร้างไฟล์มาหนึ่งไฟลแล้ว
phpinfo(); Code (PHP)
<?php
phpinfo();
?>
แล้วรันเพจนั้นดูเอาครับ
ใจร่มนะ พ่อคุณ..
|
 |
 |
 |
 |
Date :
2009-10-09 17:35:15 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วตกลงแก้ได้หรือยังครับ
|
 |
 |
 |
 |
Date :
2009-10-09 17:36:42 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ครับผม
แต่ถ้ายังไม่ได้ล่ะครับ ควรทำไงต่อ
|
 |
 |
 |
 |
Date :
2009-10-09 17:39:58 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เมื่อส่งข้อมูลไปจากฟอร์ม
ถ้า server register_globals เป็น OFF
แนะนำให้ทำการ รับค่าด้วยคำสั่ง
$_POST[ตัวแปร];
$_GET[ตัวแปร];
$_REQUEST[ตัวแปร];
เข้าสู่ตัวแปรปกติด้วยนะครับ เพราะ PHP รุ่นใหม่ ๆ มันเซนซิทีป เรื่องพวกนี้ มาก
ผมเคยตอนเริ่มเขียนใหม่ ๆ น่ะครับ ทำในเครื่อง ได้หมด ระบบใหญ่ด้วย ต้องมานั่งแก้มันใหม่หมด
เลยจำฝังหัว มันมีข้อดีตรงที่ เราสามารถเชคว่า ข้อมูลมันมาหรือเปล่า ด้วยการ ECHO ได้ และไม่ทำให้โปรแกรมมีปัญหา
ฝึก ๆ ไว้ครับ มันจะได้ชิน
|
 |
 |
 |
 |
Date :
2009-10-09 19:06:59 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แล้วตกลงแก้ได้ยังครับ เงียบไปสงสัยได้แล้ว
  
|
 |
 |
 |
 |
Date :
2009-10-09 19:08:41 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังไม่ได้ลองเลยครับ เครื่องอยู่ที่สำนักงานอ่ะ เด่วพรุ่งนี้ต้องลอง
|
 |
 |
 |
 |
Date :
2009-10-09 19:49:18 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมใช้ CentOS ไม่มีปัญหานะครับ ผมว่าต้องถาม admin server แล้วครับ ว่าไป install package แปลกๆ เปล่า
|
 |
 |
 |
 |
Date :
2009-10-10 12:34:36 |
By :
onizike |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ที่เคยเจอนะคะ บน Os window จะเป็น $_GET[varilble] แต่ถ้าตระกูล Linux น่าจะเป็น $_GET['varible']
|
 |
 |
 |
 |
Date :
2009-10-11 10:33:56 |
By :
gigza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เกี่ยวกับตัวเล็ก ตัวใหญ่ หรือเปล่าครับเช่น
$_GET["Bank"];
$_GET["bank"];
|
 |
 |
 |
 |
Date :
2009-10-11 10:58:40 |
By :
ariya99 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
thank you very much
|
 |
 |
 |
 |
Date :
2009-10-11 12:34:14 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
โอเคครับได้แล้วครับ
แต่ติดปัญหาคือ ผมลองใช้เครื่อง server ที่เป็น OS fedora แล้วใช้ localhost เครื่อง server ได้ครบทุกอย่าง
แต่พอ ใช้เครื่องทั่วไปเรียก หน้าเพจ แต่ใช้ไม่ได้ อากรเป็นเหมือนตอนแรกเลยครับ
|
 |
 |
 |
 |
Date :
2009-10-11 13:24:11 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|