作者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