我正在开发一个网站 php,该网站有一个测验部分,测验部分包含 50 个问题,每个问题都有四个选项,我们需要在提交框中输入任何选项.....我做了它的 php,但没有成功
我创建 preg_match('/Question no:(.*?)
if(preg_match('/input type=\"text\" name=\"(.*)\" id=\"(.*)\" value=\"Type your answer here\" style=\"border:0 none;\"/i',$dt,$n))
$ans_field = $n[1];
$post_data3 = "qxci=$qxci";
curl_setopt($ch, CURLOPT_URL,"hhttp://www.faasty.com/quiz.php");
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: application/x-www-form-urlencoded","Accept: */*"));
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data3);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$at = curl_exec($ch);
现在的问题是这个网站的问题和选项不是文本格式,它是图像 src 形式假设
question is
"""Goal attack" and "Wing defence" are positions in which sport?""
it have below image src
<p><img src="http://www.faasty.com/Views/fiJOvNRrVW.php?iaodifu=1730" height="200" width="379"/></p>
对于这个问题,四个选项是
a cricket
<p class='q_bg1_qq fl'>
<img src="http://www.faasty.com/unsanswerit.php?iaodifu=1"/></p>
b.baseball
<p class='q_bg1_qq fr'>
<img src="http://www.faasty.com/unsanswerit.php?iaodifu=1"/></p>
cgolf
<p class='q_bg1_qq f2'>
<img src="http://www.faasty.com/unsanswerit.php?iaodifu=1"/></p>
d betminton
<p class='q_bg1_qq fr'>
<img src="http://www.faasty.com/unsanswerit.php?iaodifu=1"/></p>
现在输入的源代码是
<input type="text" name="zQnBWllwYI" id="zQnBWllwYI" value="Type your answer here" style="display:none;" onBlur="javascript:FillValueOnBlur('zQnBWllwYI','Type your answer here');" onFocus="javascript:FillValueOnFocus('zQnBWllwYI','Type your answer here');" class="inpt_qq fl">
并提交框源是
<div class="comman_btn m_none fl"><a href="javascript:void(0)" onclick = "javascript:ScrollUp(70);CHECKFORM_METHOD();">Submit</a></div>
现在请告诉我如何用 php 在提交框中填写选项