heeha Posted February 22, 2019 Share Posted February 22, 2019 I was using a api from google but whenever i pass it though a form via post, it gets me error. Invalid value ''.https://google.com.'/'. Values must match the following regular expression: '(?i)http(s)?://.*' [locationType] => parameter [location] => url ) ) [code] => 400 [message] => Invalid value ''.https://google.com.'/'. Values must match the following regular expression: '(?i)http(s)?://.*' ) ) <?php if(isset($_POST['url'])){ $url = $_POST['url']; ( I hid code rest code because of api But i get above error. ) $val = json_decode($result, true); //return $val; print_r($val); } ?> <form action="" method="post"> Url <input type="url" name="url"> </form> What should be added to pass url variable correctly? I tried using w3school method but i still get the same error. Link to comment Share on other sites More sharing options...
gw1500se Posted February 22, 2019 Share Posted February 22, 2019 W3school is the last resource you should try. In any case the code you omitted is the code we need to see, particularly the headers you are setting to send. Yo don't send post data in the UR per se. Are you using curl or pecl? Link to comment Share on other sites More sharing options...
ginerjm Posted February 22, 2019 Share Posted February 22, 2019 Not sure on the format of the url value you supply, but how do you intend to 'pass' this value using the form you displayed? There is no submit entry. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.