Hi.
I am making some php program, using
simple test browser (PHP scriptable browser).
[login to view URL]
I am accessing from [login to view URL] to [login to view URL] below.
====access.php===================================
$browser = new SimpleBrowser();
$browser->addHeader('User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)');
$browser-> useCookies();
$browser-> useFrames();
$browser->get("http://foobar/[login to view URL]");
$browser->setField("aa", "2");
$browser->setField("bb","2014/06/03");
$browser->clickSubmit("se");
echo $browser->getContent();
=======================================
===test.php===================================
<form name="test" method="post" action="">
<input type="radio" name="aa"
VALUE="1" CHECKED>
<input type="radio" name="aa" VALUE="2">
<SELECT NAME="bb">
<OPTION VALUE="2014/05/30">z
<OPTION VALUE="2014/06/02">a
<OPTION VALUE="2014/06/03">b
<OPTION VALUE="2014/06/04">c
<OPTION VALUE="2014/06/05">d
<OPTION VALUE="2014/06/06">e
<OPTION VALUE="2014/06/09">f
<OPTION VALUE="2014/06/10">g
</SELECT> <input type="submit" value="se"
name="send">
</form>
<?php
if(isset($_POST['send'])){
var_dump($_POST);
}
=====================================
But the var_dump() of [login to view URL] (result of [login to view URL]) gets like this
=====================================
array
'aa' => string '2' (length=1)
'bb' => string '' (length=0)
'send' => string 'se' (length=2)
=====================================
The problem is it gets empty data of 'bb'.
The last post() method does not output proper data against select sentence of html.
So, please fix this setField() function bug of scriptable browser class source,
At last, I will rewrite the source of class by own.
So please tell me where to rewrite.
If this is just my mistaken or misunderstandinga of using this php scriptable browser,
then please notify me.
At that time, I will send milestone to you as fee of the information.
If there is some comments or notifications,
I'm glad to hear.
Thanks.
You aren't closing your option tags. You'll need to do that and then the code should work properly.
Example:
<select name="bb">
<option value="2014/05/30">z</option>
<option value="2014/06/02">a</option>
</select>
etc.
$15 USD en 1 día
5,0 (7 comentarios)
2,2
2,2
2 freelancers están ofertando un promedio de $25 USD por este trabajo