如何使用图像src的preg匹配功能

时间:2013-10-08 07:23:19

标签: php

我正在网站上工作php该网站有一个测验部分测验部分包含50个问题,每个问题都有四个选项我们需要在提交框中放任何选项.....我做了它的PHP但是没有得到成功

这是我创建的PHP     preg_match('/问题号:(。*?)

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

填写提交框中的选项

0 个答案:

没有答案