[請益] 關於 _$GET()..

看板PHP作者 (mm)時間16年前 (2009/08/24 21:41), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
我想請問一下@@ 在第二行的$play_num =$_GET["play_num"] $_GET["play_num"]的值是從那邊傳進來的?? 還是它一開始就是0? <? $play_num =$_GET["play_num"]; if($play_num<1){$play_num=1;} if(file_exists(($play_num+1).".txt") == true){ $play_num_next=$play_num+1; } else { $play_num_next=1; } ?> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <meta http-equiv="refresh" content="5 url=news.php?play_num=<?echo $play_num_next;?>"> <link href="../css/school.css" rel="stylesheet" type="text/css"> </head> <style type="text/css"> <!-- body{cursor:url("../../2/left/image/mouse.ico")} --> </style> <body background="index_r6_c9.png" style="background-image: url('index_r6_c9.png')"><font size="5"> <? $fp = fopen($play_num_next.".txt" , "r"); while (!feof($fp)) { $text .= fgets($fp); } fclose($fp); echo nl2br($text); ?> </font> </body> </html> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.41.131.17 ※ 編輯: mmfily 來自: 114.41.131.17 (08/24 21:41)

08/24 23:34, , 1F
不清楚get如何使用嗎? 於網址後方加入?play_num=數值
08/24 23:34, 1F
※ 編輯: mmfily 來自: 114.41.131.17 (08/25 00:29)
文章代碼(AID): #1AafX-ur (PHP)
文章代碼(AID): #1AafX-ur (PHP)