Grandong Posted October 30, 2015 Share Posted October 30, 2015 i cannot submit form if name using this $search['guestTypes[0].amount']='1'; always get error: Malformed field path "guestTypes[0].amount" i try using: $html = $crawler->html(); $html = str_replace('[', '%5B', $html); $html = str_replace(']', '%5D', $html); $crawler->clear(); $crawler->add($html); but iam not lucky...someone help me please... Quote Link to comment https://forums.phpfreaks.com/topic/298945-domcrawler-error-malformed-field-path/ Share on other sites More sharing options...
ginerjm Posted October 30, 2015 Share Posted October 30, 2015 Is that a PHP error? Quote Link to comment https://forums.phpfreaks.com/topic/298945-domcrawler-error-malformed-field-path/#findComment-1524902 Share on other sites More sharing options...
Grandong Posted October 30, 2015 Author Share Posted October 30, 2015 Is that a PHP error? this error msg: Malformed field path "guestTypes[0].amount" Quote Link to comment https://forums.phpfreaks.com/topic/298945-domcrawler-error-malformed-field-path/#findComment-1524904 Share on other sites More sharing options...
benanamen Posted October 30, 2015 Share Posted October 30, 2015 OP, are you using Goutte? Quote Link to comment https://forums.phpfreaks.com/topic/298945-domcrawler-error-malformed-field-path/#findComment-1524905 Share on other sites More sharing options...
ginerjm Posted October 30, 2015 Share Posted October 30, 2015 Doesn't look like a php error, but then I haven't seen them all. Quote Link to comment https://forums.phpfreaks.com/topic/298945-domcrawler-error-malformed-field-path/#findComment-1524906 Share on other sites More sharing options...
Grandong Posted October 30, 2015 Author Share Posted October 30, 2015 (edited) OP, are you using Goutte? Yes.. my code like: $crawler = $client->request('GET', $url); $html = $crawler->html(); $html = str_replace('[', '%5B', $html); $html = str_replace(']', '%5D', $html); $crawler->clear(); $crawler->add($html); $search = $crawler->filterXPath('//form[@id="inputForm"]')->form(); $search->disableValidation(); $search['guestTypes[0].amount']='1'; $crawler = $client->submit($search); Edited October 30, 2015 by Grandong Quote Link to comment https://forums.phpfreaks.com/topic/298945-domcrawler-error-malformed-field-path/#findComment-1524907 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.