作者f62581 (Flora)
看板PHP
標題[請益] 如何用php網頁改變radio box的選擇值
時間Wed Jun 15 09:03:17 2011
不好意思 標題下的不太好
我現在想求救的部分是 我想寫一個php要改變google scholar 學術搜尋偏好的預設設定
因為我要擷取scholar上的資料 需要用到BibTex這個文獻管理軟體
但是設定BibTeX的這部分是用到radio box 我無法送array去改變它的設定
我的程式如下
<?php
include("LIB/LIB_parse.php");
include("LIB/LIB_http.php");
$domain = "
http://scholar.google.com.tw";
$target2 = $domain."/scholar_setprefs";
$page_array= http_get($target2,$ref="");
$data_array['hl']="en";
$data_array['num']="10";
$data_array[("input[name=scis][value=yes]")]="checked";
$data_array['slc']="some";
$data_array['scis=yes']="checked";
$data_array['submit']="設定使用偏好";
$page_array=http_get_form($target2,$ref=$target,$data_array);
echo $page_array['FILE'];
?>
我可以用array的方式送資料去改變下拉式選單的值
但卻無法改變radio box的設定
想請問有沒有人可以教我 如何改變這個radio box的設定方法
另外我也嘗試用curl的方式去送表單
但是 他都會顯示 cookie被封鎖
我直接用瀏覽器連上scholar的設定是可以設定的
但是利用我的網頁去寫入設定 卻是不行的
想請問一下 我的寫法哪裡有錯了呢?
程式如下
<?php
$ch =curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "Google Bot");
curl_setopt($ch, CURLOPT_URL,
'
http://scholar.google.com.tw//scholar_setprefs?num=50&scis=yes&scisf=4&submit=
設定使用偏好');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'c:\wamp\www\scholar\text\cookie.txt');
$result = curl_exec ($ch);
curl_close ($ch);
?>
請大家指教 謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 120.127.0.254
1F:→ allenmusic:用curl的postd看看 06/15 20:36
2F:→ allenmusic:post 打錯了 =.= 06/15 20:36
3F:→ f62581:可是我的curl部分並沒有傳送任何資料耶 是要如何用post呢? 06/15 21:12
4F:→ f62581:另外想請問一下 這個表單的傳值方式是用GET 如果用POST傳 06/15 21:13
5F:→ f62581:應該會發生問題吧?(我是這樣認為啦= =) 06/15 21:14
6F:→ allenmusic:我的經驗是get沒辦法 就試post curl post 去google 06/16 06:59
7F:→ allenmusic:curl+post 關鍵字 google看看吧 06/16 07:02
8F:→ allenmusic:當然如果還是不能就要自己分析html javascript囉 06/16 07:03
9F:→ allenmusic:多花點時間 06/16 07:04