heeha Posted February 22, 2019 Share Posted February 22, 2019 (edited) 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. Edited February 22, 2019 by cyberRobot extracted non-code from code block Quote Link to comment https://forums.phpfreaks.com/topic/308367-error-on-passing-url-through-form/ Share on other sites More sharing options...
gw1500se Posted February 22, 2019 Share Posted February 22, 2019 (edited) 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? Edited February 22, 2019 by gw1500se Quote Link to comment https://forums.phpfreaks.com/topic/308367-error-on-passing-url-through-form/#findComment-1564681 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. Quote Link to comment https://forums.phpfreaks.com/topic/308367-error-on-passing-url-through-form/#findComment-1564682 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.