Jump to content

Error on passing Url through form


heeha

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.